public abstract class PlanElementBase extends Object implements IPlanElement, Observer
IPlanElement. This class can be extended by other classes that will
offer some functionality as plan elements. This class offers some common functionalities needed by all
plan classes. When the IPlanElement.Execute(ExecutionHandle) is invoked, the
IPlanElement.ValidatePreExecution(ExecutionHandle) is invoked, the element is registered for
ExecutionStateEvent.EventName#ExecutionCancel, ExecutionStateEvent.EventName#ExecutionPause
and ExecutionStateEvent.EventName#ExecutionResume events and finally the ExecuteExtender(ExecutionHandle)
method is invoked. In case an error occurs during this call, the element's ContingencyTrigger collection
is retrieved and processed to check if there are some reactions that can be taken.| Modifier and Type | Class and Description |
|---|---|
protected static class |
PlanElementBase.ClockType
The type of clock associated with
StartClock(ClockType)
and StopClock(ClockType) |
IPlanElement.PlanElementType| Constructor and Description |
|---|
PlanElementBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
CheckStatus(ExecutionHandle Handle)
Check status of the execution.
|
void |
Execute(ExecutionHandle Handle)
Execute the element
|
protected abstract void |
ExecuteExtender(ExecutionHandle Handle)
Execute extender.
|
void |
ExecuteWithStateAwareness(ExecutionHandle Handle)
Execute with state awareness.
|
protected abstract org.slf4j.Logger |
GetExtenderLogger()
Gets the extender logger.
|
protected ExecutionPerformanceReportStateEvent |
GetPerformanceEvent()
Instantiates a new performance event populating it with the clocks it has calculated
|
void |
RegisterToRunningActionElementsRestriction(ExecutionHandle Handle)
Register to running action elements restriction.
|
protected void |
ResetClocks()
Reset clocks.
|
protected void |
StartClock(PlanElementBase.ClockType Type)
Start clock.
|
protected void |
StopClock(PlanElementBase.ClockType Type)
Stop clock.
|
void |
UnregisterToRunningActionElementsRestriction(ExecutionHandle Handle)
Unregister to running action elements restriction.
|
void |
update(Observable o,
Object arg) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitFromXML, FromXML, GetContingencyTriggers, GetID, GetModifiedVariableNames, GetName, GetNeededVariableNames, GetPlanElementType, Locate, LocateActionElements, SetContingencyResourcePick, SetName, SupportedContingencyTriggers, SupportsContingencyTriggers, ToXML, Validate, ValidatePreExecutionprotected void ResetClocks()
protected void StartClock(PlanElementBase.ClockType Type)
Type - the typeprotected void StopClock(PlanElementBase.ClockType Type)
Type - the typeprotected ExecutionPerformanceReportStateEvent GetPerformanceEvent()
public void Execute(ExecutionHandle Handle) throws ExecutionRunTimeException, ExecutionInternalErrorException, ExecutionCancelException, ExecutionBreakException
IPlanElementExecute in interface IPlanElementHandle - the execution handleExecutionRunTimeException - A runtime error occurredExecutionInternalErrorException - An internal error occurredExecutionCancelException - The execution is canceledExecutionBreakException - The execution was terminated after an explicit requestpublic void ExecuteWithStateAwareness(ExecutionHandle Handle) throws ExecutionRunTimeException, ExecutionInternalErrorException, ExecutionCancelException, ExecutionBreakException
ExecutionStateEvent.EventName#ExecutionCancel,
ExecutionStateEvent.EventName#ExecutionPause and ExecutionStateEvent.EventName#ExecutionResume events,
the ExecuteExtender(ExecutionHandle) is called, and then the element is again unregistered
from these eventsHandle - the execution handleExecutionRunTimeException - A runtime error occurredExecutionInternalErrorException - An internal error occurredExecutionCancelException - The execution was canceledExecutionBreakException - The execution was terminatedprotected abstract org.slf4j.Logger GetExtenderLogger()
protected abstract void ExecuteExtender(ExecutionHandle Handle) throws ExecutionRunTimeException, ExecutionInternalErrorException, ExecutionCancelException, ExecutionBreakException
Handle - the execution handleExecutionRunTimeException - A runtime error occurredExecutionInternalErrorException - An internal error occurredExecutionCancelException - The execution was canceledExecutionBreakException - The execution was terminatedprotected void CheckStatus(ExecutionHandle Handle) throws ExecutionCancelException, ExecutionInternalErrorException
Handle - the execution handleExecutionInternalErrorException - An internal error occurredExecutionCancelException - The execution was canceledpublic void RegisterToRunningActionElementsRestriction(ExecutionHandle Handle)
Handle - the execution handlepublic void UnregisterToRunningActionElementsRestriction(ExecutionHandle Handle)
Handle - the handlepublic void update(Observable o, Object arg)
Copyright © 2014. All Rights Reserved.