|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgr.uoa.di.madgik.execution.plan.element.PlanElementBase
public abstract class PlanElementBase
Base abstract class implementing 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.
| Nested Class Summary | |
|---|---|
protected static class |
PlanElementBase.ClockType
The type of clock associated with StartClock(ClockType)
and StopClock(ClockType) |
| Nested classes/interfaces inherited from interface gr.uoa.di.madgik.execution.plan.element.IPlanElement |
|---|
IPlanElement.PlanElementType |
| Constructor Summary | |
|---|---|
PlanElementBase()
|
|
| Method Summary | |
|---|---|
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 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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gr.uoa.di.madgik.execution.plan.element.IPlanElement |
|---|
FromXML, FromXML, GetContingencyTriggers, GetID, GetModifiedVariableNames, GetName, GetNeededVariableNames, GetPlanElementType, Locate, LocateActionElements, SetContingencyResourcePick, SetName, SupportedContingencyTriggers, SupportsContingencyTriggers, ToXML, Validate, ValidatePreExecution |
| Constructor Detail |
|---|
public PlanElementBase()
| Method Detail |
|---|
protected 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
IPlanElement
Execute in interface IPlanElementHandle - the execution handle
ExecutionRunTimeException - A runtime error occurred
ExecutionInternalErrorException - An internal error occurred
ExecutionCancelException - The execution is canceled
ExecutionBreakException - The execution was terminated after an explicit request
public 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 events
Handle - the execution handle
ExecutionRunTimeException - A runtime error occurred
ExecutionInternalErrorException - An internal error occurred
ExecutionCancelException - The execution was canceled
ExecutionBreakException - The execution was terminatedprotected abstract Logger GetExtenderLogger()
protected abstract void ExecuteExtender(ExecutionHandle Handle)
throws ExecutionRunTimeException,
ExecutionInternalErrorException,
ExecutionCancelException,
ExecutionBreakException
Handle - the execution handle
ExecutionRunTimeException - A runtime error occurred
ExecutionInternalErrorException - An internal error occurred
ExecutionCancelException - The execution was canceled
ExecutionBreakException - The execution was terminated
protected void CheckStatus(ExecutionHandle Handle)
throws ExecutionCancelException,
ExecutionInternalErrorException
Handle - the execution handle
ExecutionInternalErrorException - An internal error occurred
ExecutionCancelException - The execution was canceledpublic void RegisterToRunningActionElementsRestriction(ExecutionHandle Handle)
Handle - the execution handlepublic void UnregisterToRunningActionElementsRestriction(ExecutionHandle Handle)
Handle - the handle
public void update(Observable o,
Object arg)
update in interface Observer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||