|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
gov.nasa.arc.brahms.common.rt.ActivityCtx
gov.nasa.arc.brahms.vm.rt.VMActivityCtx
gov.nasa.arc.brahms.vm.rt.VMCompositeActivityCtx
public class VMCompositeActivityCtx
The VMCompositeActivityCtx is a composite activity context with extensions for use in the virtual machine that maintains start and end times for an activity, the duration, priority, status, state of the frames that are part of the composite activity and the active detectables of the composite activity.
| Field Summary | |
|---|---|
static java.lang.String |
DETECTABLE
Property name used with DiscreteEvent to indicate a detectable causing the end activity |
| Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants |
|---|
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE |
| Constructor Summary | |
|---|---|
VMCompositeActivityCtx(CompositeActivity act)
Constructor, creates a new context for the specified VMCompositeActivity. |
|
VMCompositeActivityCtx(CompositeActivity act,
java.lang.String id)
Constructor, creates a new context for the specified VMCompositeActivity. |
|
| Method Summary | |
|---|---|
void |
addActiveDetectable(IDetectableCtx detectable)
Adds the specified detectable as an active detectable to the list of active detectables. |
void |
addAvailableFrame(IFrameCtx frame)
Adds the specified frame context as an available frame. |
void |
addCompletedFrame(IFrameCtx frame)
Adds the given frame context as a completed frame. |
void |
addImpassedFrame(IWorkframeCtx frame)
Adds the specified frame context as an impassed frame. |
void |
addInterruptedFrame(IWorkframeCtx frame)
Adds the specified frame context as an interrupted frame. |
java.util.ListIterator |
getActiveDetectables()
Returns the list of active detectables. |
java.util.ListIterator |
getAvailableThoughtframes()
Returns a list of all the available thoughtframes. |
java.util.ListIterator |
getAvailableWorkframes()
Returns a list of all the available workframes. |
java.util.Set<java.lang.String> |
getCompletedThoughtframeNames()
Return a list of the fully qualified names for all the thoughtframes for which completed thoughtframe contexts exist. |
java.util.ListIterator |
getCompletedThoughtframes(java.lang.String frameName)
Return a list of all the completed thoughtframe contexts for the thoughtframe with the specified fully qualified name. |
java.util.Set<java.lang.String> |
getCompletedWorkframeNames()
Return a list of the fully qualified names for all the workframes for which completed workframe contexts exist. |
java.util.ListIterator |
getCompletedWorkframes(java.lang.String frameName)
Return a list of all the completed workframe contexts for the workframe with the specified fully qualified name. |
IWorkframeCtx |
getCurrentWork()
Returns the workframe currently active in the activity. |
ParameterCtx |
getEndCondition()
Returns the end-condition for the composite activity (no-work or detectable). |
java.util.ListIterator |
getImpassedFrames()
Returns a list of all the impassed workframes. |
QualifiedName |
getInternalQualifiedName()
Returns the internal qualified name for the composite activity. |
java.util.ListIterator |
getInterruptedFrames()
Returns a list of all the interrupted workframes. |
IThoughtframeCtx |
getPriorityAvailableThoughtframe()
Returns the highest priority available thoughtframe. |
IWorkframeCtx |
getPriorityAvailableWorkframe()
Returns the highest priority available workframe in the hierarchy of workframe contexts due to the use of composite activities. |
IWorkframeCtx |
getPriorityInterruptedFrame()
Returns the highest priority interrupted workframe in the hierarchy of workframe contexts due to the use of composite activities. |
boolean |
handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Process the specified discrete event. |
boolean |
hasAvailableThoughtframes()
Inficates whether there are any available thoughtframes. |
boolean |
hasAvailableWorkframes()
Inficates whether there are any available workframes. |
boolean |
hasCompletedThoughtframes()
Inficates whether there are any completed thoughtframes. |
boolean |
hasCompletedWorkframes()
Inficates whether there are any completed workframes. |
boolean |
hasImpassedFrames()
Inficates whether there are any impassed workframes. |
boolean |
hasInterruptedFrames()
Inficates whether there are any interrupted workframes. |
protected boolean |
isEndActivity()
Determines whether the activity is to be ended. |
protected void |
onAbort(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Aborts the activity, an early termination of the activity caused by a detectable's abort trigger. |
protected void |
onComplete(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Completes the activity, an early termination of the activity caused by a detectable's complete trigger. |
protected void |
onContinue(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Continues the activity from an interrupt. |
protected void |
onContinueFromImpasse(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Continues the activity from an impasse. |
protected void |
onEnd(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Ends the activity, handling any completion initializations and executing any actions that are to be executed at the end of the activity as specified for the activity. |
protected void |
onEndActivity(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Ends the activity triggered by a detectable, aborts any active work remaining. |
protected void |
onImpasse(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Impasses the activity. |
protected void |
onInterrupt(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Interrupts the activity. |
protected boolean |
onStart(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Starts the activity, handling any startup initialization and executing any actions that are to be executed at the start of the activity as specified for the activity. |
void |
removeActiveDetectable(IDetectableCtx detectable)
Removes the specified detectable as an active detectable from the list of active detectables. |
void |
removeAvailableFrame(IFrameCtx frame)
Removes the specifies frame as an available frame. |
void |
removeCompletedFrame(IFrameCtx frame)
Removes the given frame context as a completed frame context |
void |
removeImpassedFrame(IWorkframeCtx frame)
Removes the specified frame context as an impassed frame. |
void |
removeInterruptedFrame(IWorkframeCtx frame)
Removes the specified frame context as an interrupted frame. |
protected void |
sendAbortEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an abort event to the event notifier. |
protected void |
sendCompleteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a complete event to the event notifier. |
protected void |
sendContinueEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a continue event to the event notifier. |
protected void |
sendContinueFromImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a continue from impasse event to the event notifier. |
protected void |
sendEndActivityEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an end activity event to the event notifier. |
protected void |
sendEndEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an end event to the event notifier. |
protected void |
sendImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an impasse event to the event notifier. |
protected void |
sendInterruptEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an interrupt event to the event notifier. |
protected void |
sendStartEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a start event to the event notifier. |
void |
setCurrentWork(IWorkframeCtx frame)
Sets the workframe currently active in the activity |
void |
statusChanged(FrameStatusEvent evt)
Fired when the status of a frame context that is part of the composite activity changes. |
| Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMActivityCtx |
|---|
getDisplayText, getParameterCtx, getPriority, handleDiscreteEvent, resolveParameters |
| Methods inherited from class gov.nasa.arc.brahms.common.rt.ActivityCtx |
|---|
getCompletionCause, getParentFrame, getPerformedBy, getReferencedBy, getState, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setPriority, setReferencedBy, setState, setState, setStatus, toString |
| Methods inherited from class gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx |
|---|
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setContextFor, setEndTime, setID, setStartTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gov.nasa.arc.brahms.common.rt.IActivityCtx |
|---|
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, getReferencedBy, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setReferencedBy, setStatus |
| Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx |
|---|
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime |
| Field Detail |
|---|
public static final java.lang.String DETECTABLE
| Constructor Detail |
|---|
public VMCompositeActivityCtx(CompositeActivity act)
act - the VMCompositeActivity for which to create a context
public VMCompositeActivityCtx(CompositeActivity act,
java.lang.String id)
act - the VMCompositeActivity for which to create a contextid - the unique identifier for the activity context| Method Detail |
|---|
public boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
handleDiscreteEvent in interface gov.nasa.arc.brahms.vm.events.IDiscreteEventHandlerhandleDiscreteEvent in class VMActivityCtxevt - the DiscreteEvent to be processed.
protected boolean onStart(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onStart in class VMActivityCtxevt - the DiscreteEvent that initiated the start of the activity
protected void onEnd(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onEnd in class VMActivityCtxevt - the DiscreteEvent that initiated the end of the activityprotected void onEndActivity(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
evt - the DiscreteEvent that initiated the end of the activityprotected void onInterrupt(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onInterrupt in class VMActivityCtxevt - the DiscreteEvent that initiated the interruptionprotected void onContinue(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onContinue in class VMActivityCtxevt - the DiscreteEvent that initiated the continuationprotected void onImpasse(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onImpasse in class VMActivityCtxevt - the DiscreteEvent that initiated the impasseprotected void onContinueFromImpasse(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onContinueFromImpasse in class VMActivityCtxevt - the DiscreteEvent that initiated the continuationprotected void onAbort(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onAbort in class VMActivityCtxevt - the DiscreteEvent that initiated the abortprotected void onComplete(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
onComplete in class VMActivityCtxevt - the DiscreteEvent that initiated the completeprotected void sendStartEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendStartEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendEndEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendEndEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendInterruptEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendInterruptEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendContinueEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendContinueEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendImpasseEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendContinueFromImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendContinueFromImpasseEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendCompleteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendCompleteEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendAbortEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
sendAbortEvent in class VMActivityCtxevt - the DiscreteEvent that triggered the state changeprotected void sendEndActivityEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Note that this method is created for the different implementations by the sub classes of VMActivityCtx.
evt - the DiscreteEvent that triggered the state changepublic void statusChanged(FrameStatusEvent evt)
statusChanged in interface IFrameStatusListenerevt - the FrameStatusEventFrameStatusEvent
protected boolean isEndActivity()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs
public ParameterCtx getEndCondition()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no end-condition is specifiedIConstants.NOWORK,
IConstants.DETECTABLEpublic QualifiedName getInternalQualifiedName()
public void addAvailableFrame(IFrameCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addAvailableFrame in interface ICompositeActivityCtxframe - the available work or thoughtframe
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null
public void removeAvailableFrame(IFrameCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeAvailableFrame in interface ICompositeActivityCtxframe - the frame to be removed as an available frame.
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null frame is specified, no
available frames are present or the specified frame is
not present
public java.util.ListIterator getAvailableWorkframes()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getAvailableWorkframes in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no available workframespublic boolean hasAvailableWorkframes()
hasAvailableWorkframes in interface ICompositeActivityCtx
public java.util.ListIterator getAvailableThoughtframes()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getAvailableThoughtframes in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no available thoughtframespublic boolean hasAvailableThoughtframes()
hasAvailableThoughtframes in interface ICompositeActivityCtxpublic IWorkframeCtx getPriorityAvailableWorkframe()
getPriorityAvailableWorkframe in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManagerpublic IThoughtframeCtx getPriorityAvailableThoughtframe()
getPriorityAvailableThoughtframe in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
public void addInterruptedFrame(IWorkframeCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addInterruptedFrame in interface ICompositeActivityCtxframe - the interrupted workframe to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null
public void removeInterruptedFrame(IWorkframeCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeInterruptedFrame in interface ICompositeActivityCtxframe - the interrupted workframe to be removed
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null, no interrupted frames
are available, or the frame is not present as an interrupted frame
public java.util.ListIterator getInterruptedFrames()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getInterruptedFrames in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no interrupted workframespublic boolean hasInterruptedFrames()
hasInterruptedFrames in interface ICompositeActivityCtxpublic IWorkframeCtx getPriorityInterruptedFrame()
getPriorityInterruptedFrame in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
public void addImpassedFrame(IWorkframeCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addImpassedFrame in interface ICompositeActivityCtxframe - the impassed workframe to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null
public void removeImpassedFrame(IWorkframeCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeImpassedFrame in interface ICompositeActivityCtxframe - the impassed workframe to be removed
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null, no impassed frames
are available, or the frame is not present as an impassed frame
public java.util.ListIterator getImpassedFrames()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getImpassedFrames in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no impassed workframespublic boolean hasImpassedFrames()
hasImpassedFrames in interface ICompositeActivityCtx
public void addCompletedFrame(IFrameCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addCompletedFrame in interface ICompositeActivityCtxframe - the IFrameCtx to be added as a completed frame
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame context is null or frame context
references no frame
public void removeCompletedFrame(IFrameCtx frame)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeCompletedFrame in interface ICompositeActivityCtxframe - the frame context to be removed
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null, no completed frames exist for
the frame for which the specified frame is a context or if the
specified frame context is not found or if the specified frame
is not referencing a workframe or thoughtframe
public java.util.ListIterator getCompletedWorkframes(java.lang.String frameName)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getCompletedWorkframes in interface ICompositeActivityCtxframeName - the fully qualified name for the workframe
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid name is specified or no completed frames exist
public java.util.Set<java.lang.String> getCompletedWorkframeNames()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getCompletedWorkframeNames in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed frames existpublic boolean hasCompletedWorkframes()
hasCompletedWorkframes in interface ICompositeActivityCtx
public java.util.ListIterator getCompletedThoughtframes(java.lang.String frameName)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getCompletedThoughtframes in interface ICompositeActivityCtxframeName - the fully qualified name for the thoughtframe
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid name is specified or no completed frames exist
public java.util.Set<java.lang.String> getCompletedThoughtframeNames()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getCompletedThoughtframeNames in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed frames existpublic boolean hasCompletedThoughtframes()
hasCompletedThoughtframes in interface ICompositeActivityCtxpublic void setCurrentWork(IWorkframeCtx frame)
setCurrentWork in interface ICompositeActivityCtxframe - the current work (IWorkframeCtx) of the activitypublic IWorkframeCtx getCurrentWork()
getCurrentWork in interface ICompositeActivityCtxgetCurrentWork in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
public void addActiveDetectable(IDetectableCtx detectable)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addActiveDetectable in interface ICompositeActivityCtxdetectable - the IDetectableCtx for the detectable active in the activity
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detectable is null
public void removeActiveDetectable(IDetectableCtx detectable)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeActiveDetectable in interface ICompositeActivityCtxdetectable - the IDetectableCtx for the detectable to be removed as an active detectable
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detectable is null or no active detectables exist
or the specified detectable is not found
public java.util.ListIterator getActiveDetectables()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getActiveDetectables in interface ICompositeActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no active detectables exist
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||