gov.nasa.arc.brahms.vm.rt
Class VMCompositeActivityCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ActivityCtx
          extended by gov.nasa.arc.brahms.vm.rt.VMActivityCtx
              extended by gov.nasa.arc.brahms.vm.rt.VMCompositeActivityCtx
All Implemented Interfaces:
IActivityCtx, IBrahmsObjectCtx, ICompositeActivityCtx, IRuntimeConstants, gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager, gov.nasa.arc.brahms.vm.engine.IWorkManager, gov.nasa.arc.brahms.vm.events.IDiscreteEventData, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler, IFrameStatusListener, java.io.Serializable, java.util.EventListener

public class VMCompositeActivityCtx
extends VMActivityCtx
implements ICompositeActivityCtx, IFrameStatusListener, gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager

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.

Version:
$Revision: 1.4 $ $Date: 2009/11/23 23:53:31 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
Serialized Form

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

DETECTABLE

public static final java.lang.String DETECTABLE
Property name used with DiscreteEvent to indicate a detectable causing the end activity

See Also:
Constant Field Values
Constructor Detail

VMCompositeActivityCtx

public VMCompositeActivityCtx(CompositeActivity act)
Constructor, creates a new context for the specified VMCompositeActivity.

Parameters:
act - the VMCompositeActivity for which to create a context

VMCompositeActivityCtx

public VMCompositeActivityCtx(CompositeActivity act,
                              java.lang.String id)
Constructor, creates a new context for the specified VMCompositeActivity.

Parameters:
act - the VMCompositeActivity for which to create a context
id - the unique identifier for the activity context
Method Detail

handleDiscreteEvent

public boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Process the specified discrete event.

Specified by:
handleDiscreteEvent in interface gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler
Overrides:
handleDiscreteEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent to be processed.
Returns:
boolean true if the event could be processed, false if not

onStart

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.

Overrides:
onStart in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the start of the activity
Returns:
boolean true if the activity was started, false if not

onEnd

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.

Overrides:
onEnd in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the end of the activity

onEndActivity

protected void onEndActivity(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Ends the activity triggered by a detectable, aborts any active work remaining.

Parameters:
evt - the DiscreteEvent that initiated the end of the activity

onInterrupt

protected void onInterrupt(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Interrupts the activity.

Overrides:
onInterrupt in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the interruption

onContinue

protected void onContinue(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Continues the activity from an interrupt.

Overrides:
onContinue in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the continuation

onImpasse

protected void onImpasse(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Impasses the activity.

Overrides:
onImpasse in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the impasse

onContinueFromImpasse

protected void onContinueFromImpasse(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Continues the activity from an impasse.

Overrides:
onContinueFromImpasse in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the continuation

onAbort

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.

Overrides:
onAbort in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the abort

onComplete

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.

Overrides:
onComplete in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that initiated the complete

sendStartEvent

protected void sendStartEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a start event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendStartEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendEndEvent

protected void sendEndEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an end event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendEndEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendInterruptEvent

protected void sendInterruptEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an interrupt event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendInterruptEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendContinueEvent

protected void sendContinueEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a continue event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendContinueEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendImpasseEvent

protected void sendImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an impasse event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendImpasseEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendContinueFromImpasseEvent

protected void sendContinueFromImpasseEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a continue from impasse event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendContinueFromImpasseEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendCompleteEvent

protected void sendCompleteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends a complete event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendCompleteEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendAbortEvent

protected void sendAbortEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an abort event to the event notifier.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Overrides:
sendAbortEvent in class VMActivityCtx
Parameters:
evt - the DiscreteEvent that triggered the state change

sendEndActivityEvent

protected void sendEndActivityEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Sends an end activity event to the event notifier. This end activity is like an abort triggered by a detectable.

Note that this method is created for the different implementations by the sub classes of VMActivityCtx.

Parameters:
evt - the DiscreteEvent that triggered the state change

statusChanged

public void statusChanged(FrameStatusEvent evt)
Fired when the status of a frame context that is part of the composite activity changes. The frame context that changed status and the old and new status are captured by the event.

Specified by:
statusChanged in interface IFrameStatusListener
Parameters:
evt - the FrameStatusEvent
See Also:
FrameStatusEvent

isEndActivity

protected boolean isEndActivity()
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Determines whether the activity is to be ended. This method is only called when a sub frame is completed. We then need to determine whether more work is available and if not whether the end condition is not work. If the end condition is indeed nowork and there is no work available then we return true.

Returns:
true if the activity is to be ended, false otherwise
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an internal error occurs

getEndCondition

public ParameterCtx getEndCondition()
                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the end-condition for the composite activity (no-work or detectable). The end-condition is set through a parameter context containing either the actual value or a reference to a variable containing the end-condition value.

Returns:
ParameterCtx containing an integer value defining the end-condition of the composite activity
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no end-condition is specified
See Also:
IConstants.NOWORK, IConstants.DETECTABLE

getInternalQualifiedName

public QualifiedName getInternalQualifiedName()
Returns the internal qualified name for the composite activity. The internal qualified name of the composite activity identifies where the call to this activity is located in the hierarchy if composite activities are used. The location is determined based on potential calls to the activity ref in a frame through potentially other activity references. It will just be the parent frame's name with the activity ref id if its a level 1 frame (not in a composite activity), it will be a nesting of wf names and activity ref ids if the workframe in which the activity ref is called is in a composite activity, (. or ... etc.)

Returns:
String the internal qualified name

addAvailableFrame

public void addAvailableFrame(IFrameCtx frame)
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified frame context as an available frame.

Specified by:
addAvailableFrame in interface ICompositeActivityCtx
Parameters:
frame - the available work or thoughtframe
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null

removeAvailableFrame

public void removeAvailableFrame(IFrameCtx frame)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specifies frame as an available frame.

Specified by:
removeAvailableFrame in interface ICompositeActivityCtx
Parameters:
frame - the frame to be removed as an available frame.
Throws:
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

getAvailableWorkframes

public java.util.ListIterator getAvailableWorkframes()
                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the available workframes.

Specified by:
getAvailableWorkframes in interface ICompositeActivityCtx
Returns:
ListIterator an iterator returning a list of IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no available workframes

hasAvailableWorkframes

public boolean hasAvailableWorkframes()
Inficates whether there are any available workframes.

Specified by:
hasAvailableWorkframes in interface ICompositeActivityCtx
Returns:
boolean true if there are one or more available workframe instantiations, false otherwise

getAvailableThoughtframes

public java.util.ListIterator getAvailableThoughtframes()
                                                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the available thoughtframes.

Specified by:
getAvailableThoughtframes in interface ICompositeActivityCtx
Returns:
ListIterator an iterator returning a list of IThoughtframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no available thoughtframes

hasAvailableThoughtframes

public boolean hasAvailableThoughtframes()
Inficates whether there are any available thoughtframes.

Specified by:
hasAvailableThoughtframes in interface ICompositeActivityCtx
Returns:
boolean true if there are one or more available thoughtframe instantiations, false otherwise

getPriorityAvailableWorkframe

public IWorkframeCtx getPriorityAvailableWorkframe()
Returns the highest priority available workframe in the hierarchy of workframe contexts due to the use of composite activities.

Specified by:
getPriorityAvailableWorkframe in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
Returns:
IWorkframeCtx the context of the highest priority available workframe, null if there are no available workframes.

getPriorityAvailableThoughtframe

public IThoughtframeCtx getPriorityAvailableThoughtframe()
Returns the highest priority available thoughtframe.

Specified by:
getPriorityAvailableThoughtframe in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
Returns:
IThoughtframeCtx the context of the highest priority available thoughtframe, null if there are no available thoughtframes.

addInterruptedFrame

public void addInterruptedFrame(IWorkframeCtx frame)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified frame context as an interrupted frame.

Specified by:
addInterruptedFrame in interface ICompositeActivityCtx
Parameters:
frame - the interrupted workframe to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null

removeInterruptedFrame

public void removeInterruptedFrame(IWorkframeCtx frame)
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified frame context as an interrupted frame.

Specified by:
removeInterruptedFrame in interface ICompositeActivityCtx
Parameters:
frame - the interrupted workframe to be removed
Throws:
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

getInterruptedFrames

public java.util.ListIterator getInterruptedFrames()
                                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the interrupted workframes.

Specified by:
getInterruptedFrames in interface ICompositeActivityCtx
Returns:
ListIterator an iterator returning a list of IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no interrupted workframes

hasInterruptedFrames

public boolean hasInterruptedFrames()
Inficates whether there are any interrupted workframes.

Specified by:
hasInterruptedFrames in interface ICompositeActivityCtx
Returns:
boolean true if there are one or more interrupted workframe instantiations, false otherwise

getPriorityInterruptedFrame

public IWorkframeCtx getPriorityInterruptedFrame()
Returns the highest priority interrupted workframe in the hierarchy of workframe contexts due to the use of composite activities.

Specified by:
getPriorityInterruptedFrame in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
Returns:
IWorkframeCtx the context of the highest priority interrupted workframe, null if there are no interrupted workframes.

addImpassedFrame

public void addImpassedFrame(IWorkframeCtx frame)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified frame context as an impassed frame.

Specified by:
addImpassedFrame in interface ICompositeActivityCtx
Parameters:
frame - the impassed workframe to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame is null

removeImpassedFrame

public void removeImpassedFrame(IWorkframeCtx frame)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified frame context as an impassed frame.

Specified by:
removeImpassedFrame in interface ICompositeActivityCtx
Parameters:
frame - the impassed workframe to be removed
Throws:
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

getImpassedFrames

public java.util.ListIterator getImpassedFrames()
                                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the impassed workframes.

Specified by:
getImpassedFrames in interface ICompositeActivityCtx
Returns:
ListIterator an iterator returning a list of IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no impassed workframes

hasImpassedFrames

public boolean hasImpassedFrames()
Inficates whether there are any impassed workframes.

Specified by:
hasImpassedFrames in interface ICompositeActivityCtx
Returns:
boolean true if there are one or more impassed workframe instantiations, false otherwise

addCompletedFrame

public void addCompletedFrame(IFrameCtx frame)
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the given frame context as a completed frame. This method is used by the virtual machine to store non repearing frames and this method can be used by other components to store a history of executed frames.

Specified by:
addCompletedFrame in interface ICompositeActivityCtx
Parameters:
frame - the IFrameCtx to be added as a completed frame
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if frame context is null or frame context references no frame

removeCompletedFrame

public void removeCompletedFrame(IFrameCtx frame)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the given frame context as a completed frame context

Specified by:
removeCompletedFrame in interface ICompositeActivityCtx
Parameters:
frame - the frame context to be removed
Throws:
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

getCompletedWorkframes

public java.util.ListIterator getCompletedWorkframes(java.lang.String frameName)
                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of all the completed workframe contexts for the workframe with the specified fully qualified name.

Specified by:
getCompletedWorkframes in interface ICompositeActivityCtx
Parameters:
frameName - the fully qualified name for the workframe
Returns:
ListIterator the list of completed IWorkframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid name is specified or no completed frames exist

getCompletedWorkframeNames

public java.util.Set<java.lang.String> getCompletedWorkframeNames()
                                                           throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of the fully qualified names for all the workframes for which completed workframe contexts exist.

Specified by:
getCompletedWorkframeNames in interface ICompositeActivityCtx
Returns:
Set the names of workframes for which completed IWorkframeCtx exist
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed frames exist

hasCompletedWorkframes

public boolean hasCompletedWorkframes()
Inficates whether there are any completed workframes.

Specified by:
hasCompletedWorkframes in interface ICompositeActivityCtx
Returns:
boolean true if there are one or more completed workframe instantiations, false otherwise

getCompletedThoughtframes

public java.util.ListIterator getCompletedThoughtframes(java.lang.String frameName)
                                                 throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of all the completed thoughtframe contexts for the thoughtframe with the specified fully qualified name.

Specified by:
getCompletedThoughtframes in interface ICompositeActivityCtx
Parameters:
frameName - the fully qualified name for the thoughtframe
Returns:
ListIterator the list of completed IThoughtframeCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if an invalid name is specified or no completed frames exist

getCompletedThoughtframeNames

public java.util.Set<java.lang.String> getCompletedThoughtframeNames()
                                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Return a list of the fully qualified names for all the thoughtframes for which completed thoughtframe contexts exist.

Specified by:
getCompletedThoughtframeNames in interface ICompositeActivityCtx
Returns:
Set the names of thoughtframes for which completed IThoughtframeCtx exist
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed frames exist

hasCompletedThoughtframes

public boolean hasCompletedThoughtframes()
Inficates whether there are any completed thoughtframes.

Specified by:
hasCompletedThoughtframes in interface ICompositeActivityCtx
Returns:
boolean true if there are one or more completed thoughtframe instantiations, false otherwise

setCurrentWork

public void setCurrentWork(IWorkframeCtx frame)
Sets the workframe currently active in the activity

Specified by:
setCurrentWork in interface ICompositeActivityCtx
Parameters:
frame - the current work (IWorkframeCtx) of the activity

getCurrentWork

public IWorkframeCtx getCurrentWork()
Returns the workframe currently active in the activity. Thoughtframes take no time and are therefor never set as current work.

Specified by:
getCurrentWork in interface ICompositeActivityCtx
Specified by:
getCurrentWork in interface gov.nasa.arc.brahms.vm.engine.IPriorityWorkManager
Returns:
IWorkframeCtx the current work of the activity, null if the activity has no current work

addActiveDetectable

public void addActiveDetectable(IDetectableCtx detectable)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified detectable as an active detectable to the list of active detectables. An active detectable is actively checked while the activity is active.

Specified by:
addActiveDetectable in interface ICompositeActivityCtx
Parameters:
detectable - the IDetectableCtx for the detectable active in the activity
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detectable is null

removeActiveDetectable

public void removeActiveDetectable(IDetectableCtx detectable)
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified detectable as an active detectable from the list of active detectables.

Specified by:
removeActiveDetectable in interface ICompositeActivityCtx
Parameters:
detectable - the IDetectableCtx for the detectable to be removed as an active detectable
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the detectable is null or no active detectables exist or the specified detectable is not found

getActiveDetectables

public java.util.ListIterator getActiveDetectables()
                                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the list of active detectables.

Specified by:
getActiveDetectables in interface ICompositeActivityCtx
Returns:
ListIterator the list of active detectables (IDetectableCtx)
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no active detectables exist


Copyright © 1997-2012 All Rights Reserved.