gov.nasa.arc.brahms.common.rt
Class WorkframeCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.FrameCtx
          extended by gov.nasa.arc.brahms.common.rt.WorkframeCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IFrameCtx, IRuntimeConstants, IWorkframeCtx, java.io.Serializable

public class WorkframeCtx
extends FrameCtx
implements IWorkframeCtx

The WorkframeCtx maintains the state for a workframe. In addition to keeping track of the state information as defined in the FrameCtx the workframe context also tracks the activity currently executed in the frame, the activities that have completed and the detectable contexts defining the detectables that were executed in the context of the workframe.

Version:
11 July 2000
Author:
Ron van Hoof
See Also:
FrameCtx, Serialized Form

Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, DETECTABLE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE
 
Constructor Summary
WorkframeCtx(Workframe frame)
          Constructor, creates a new context for the specified workframe.
 
Method Summary
 void addActiveDetectable(IDetectableCtx detectable)
          Adds the specified detectable as an active detectable to the list of active detectables.
 void addCompletedActivity(ActivityCtx act)
          Adds the specified activity as a completed activity to the list of completed activities.
 java.util.ListIterator getActiveDetectables()
          Returns the list of active detectables.
 java.util.ListIterator getCompletedActivities()
          Returns the list of completed activities.
 ActivityCtx getCurrentActivity()
          Returns the activity currently active in the workframe
 void removeActiveDetectable(IDetectableCtx detectable)
          Removes the specified detectable as an active detectable from the list of active detectables.
 void removeCompletedActivity(ActivityCtx act)
          Removes the specified activity as a completed activity from the list of completed activities.
 void setCurrentActivity(ActivityCtx act)
          Sets the activity currently active in the workframe
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.FrameCtx
addBinding, addFiredConsequence, getBinding, getBindings, getFiredConsequences, getPerformedBy, getPerformedIn, getPriority, getState, getStatus, getTimeAvailable, removeBinding, removeFiredConsequence, setPerformedBy, setPerformedIn, setPriority, setState, setState, setStatus, setTimeAvailable, 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.IFrameCtx
addBinding, addFiredConsequence, getBinding, getBindings, getFiredConsequences, getPerformedBy, getPerformedIn, getPriority, getState, getStatus, getTimeAvailable, removeBinding, removeFiredConsequence, setPerformedBy, setPerformedIn, setPriority, setState, setState, setStatus, setTimeAvailable
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

WorkframeCtx

public WorkframeCtx(Workframe frame)
Constructor, creates a new context for the specified workframe.

Parameters:
frame - the Workframe for which this frame context is a context
Method Detail

setCurrentActivity

public void setCurrentActivity(ActivityCtx act)
Sets the activity currently active in the workframe

Specified by:
setCurrentActivity in interface IWorkframeCtx
Parameters:
act - the current activity (ActivityCtx)

getCurrentActivity

public ActivityCtx getCurrentActivity()
Returns the activity currently active in the workframe

Specified by:
getCurrentActivity in interface IWorkframeCtx
Returns:
ActivityCtx the current activity (ActivityCtx) of the workframe context, null if the workframe context has no activity active

addCompletedActivity

public void addCompletedActivity(ActivityCtx act)
                          throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified activity as a completed activity to the list of completed activities.

Specified by:
addCompletedActivity in interface IWorkframeCtx
Parameters:
act - the ActivityCtx for the activity completed in the workframe
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the activity is null

removeCompletedActivity

public void removeCompletedActivity(ActivityCtx act)
                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified activity as a completed activity from the list of completed activities.

Specified by:
removeCompletedActivity in interface IWorkframeCtx
Parameters:
act - the ActivityCtx for the activity to be removed as a completed activity
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the activity is null or no completed activities exist or the specified activity is not found

getCompletedActivities

public java.util.ListIterator getCompletedActivities()
                                              throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the list of completed activities.

Specified by:
getCompletedActivities in interface IWorkframeCtx
Returns:
ListIterator the list of completed activities (ActivityCtx)
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no completed activities exist

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 workframe is active.

Specified by:
addActiveDetectable in interface IWorkframeCtx
Parameters:
detectable - the IDetectableCtx for the detectable active in the workframe
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 IWorkframeCtx
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 IWorkframeCtx
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.