|
||||||||||
| 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.VMPrimitiveActivityCtx
public class VMPrimitiveActivityCtx
The VMPrimitiveActivityCtx is a primitive activity context with extensions for use in the virtual machine. It maintains the context of a primitive activity being or to be executed by an active instance. The context maintains the start and end times for an activity, the duration, priority, status, randomness, duration and resources.
| 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 | |
|---|---|
|
VMPrimitiveActivityCtx(PrimitiveActivity act)
Constructor, creates a new context for the specified VMPrimitiveActivity. |
protected |
VMPrimitiveActivityCtx(PrimitiveActivity act,
java.lang.String id)
Constructor, creates a new context for the specified VMPrimitiveActivity. |
| Method Summary | |
|---|---|
void |
addResource(ParameterCtx resource)
Adds the specified resource as a resource for this activity. |
long |
getDuration()
Returns the calculated duration of the activity used by the VM |
long |
getElapsedTime()
Returns the elapsed time when the activity has been active |
ParameterCtx |
getMaxDuration()
Returns the maximum duration of the activity. |
ParameterCtx |
getMinDuration()
returns the minimum duration of the activity. |
ParameterCtx |
getRandom()
Returns whether the duration of the activity is random or not. |
int |
getResourceCount()
Return the number of resources associated with the activity. |
java.util.Enumeration |
getResources()
Returns a list of all the resources (ParameterCtx). |
void |
removeResource(ParameterCtx resource)
Removes the specified resource as a resource for this activity. |
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 |
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 |
setElapsedTime(long elapsedTime)
Specifies the elapsed time when the activity has been active |
| Methods inherited from class gov.nasa.arc.brahms.vm.rt.VMActivityCtx |
|---|
getDisplayText, getParameterCtx, getPriority, handleDiscreteEvent, handleDiscreteEvent, onAbort, onComplete, onContinue, onContinueFromImpasse, onEnd, onImpasse, onInterrupt, onStart, 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 |
| Constructor Detail |
|---|
public VMPrimitiveActivityCtx(PrimitiveActivity act)
act - the VMPrimitiveActivity for which to create a context
protected VMPrimitiveActivityCtx(PrimitiveActivity act,
java.lang.String id)
act - the VMPrimitiveActivity for which to create a contextid - the unique identifier for the activity context| Method Detail |
|---|
public ParameterCtx getRandom()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getRandom in interface IPrimitiveActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no random indicator is specified
public ParameterCtx getMinDuration()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getMinDuration in interface IPrimitiveActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no minimum duration is specified
public ParameterCtx getMaxDuration()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getMaxDuration in interface IPrimitiveActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if no maximum duration is specifiedpublic long getDuration()
getDuration in interface IPrimitiveActivityCtxpublic void setElapsedTime(long elapsedTime)
setElapsedTime in interface IPrimitiveActivityCtxelapsedTime - the activities elapsed timepublic long getElapsedTime()
getElapsedTime in interface IPrimitiveActivityCtx
public void addResource(ParameterCtx resource)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addResource in interface IPrimitiveActivityCtxresource - the resource (ParameterCtx) to be added
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if resource is null
public void removeResource(ParameterCtx resource)
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeResource in interface IPrimitiveActivityCtxresource - the resource (ParameterCtx) to be removed
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if resource is null, no resources
are available, or the resource is not found
public java.util.Enumeration getResources()
throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getResources in interface IPrimitiveActivityCtxgov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no resourcespublic int getResourceCount()
getResourceCount in interface IPrimitiveActivityCtxprotected 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 change
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||