|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.googlecode.sarasvati.mem.MemGraphProcess
public class MemGraphProcess
Constructor Summary | |
---|---|
MemGraphProcess(Graph graph)
|
Method Summary | |
---|---|
void |
addActiveArcToken(ArcToken token)
Adds an ArcToken to the list of active ArcTokens. |
void |
addActiveNodeToken(NodeToken token)
Adds a NodeToken to the list of active NodeTokens. |
void |
addNodeToken(NodeToken token)
Adds a NodeToken to the list of all NodeTokens for this process. |
ArcToken |
dequeueArcTokenForExecution()
Returns the next ArcToken to execute |
void |
enqueueArcTokenForExecution(ArcToken token)
Adds an arc token to the execution queue |
List<ArcToken> |
getActiveArcTokens()
Returns the list of current ArcTokens. |
List<NodeToken> |
getActiveNodeTokens()
Returns the list of current NodeTokens. |
Env |
getEnv()
Returns the environment for the process. |
ExecutionEventQueue |
getEventQueue()
Returns the event queue which manages the set of listeners for the instance and handles firing events to those listeners. |
Graph |
getGraph()
Returns the graph being executed. |
List<NodeToken> |
getNodeTokens()
Returns the list of all NodeTokens. |
NodeToken |
getParentToken()
If this a nested process, then this will return the parent NodeToken and null otherwise. |
ProcessState |
getState()
Returns the current ProcessState |
List<NodeToken> |
getTokensOnNode(Node node,
Engine engine)
Returns the collection of NodeTokens which have been created on the given Node. |
boolean |
hasActiveTokens()
Return true if the process has any active arc or node tokens. |
boolean |
isArcTokenQueueEmpty()
Return true if the arc token queue is empty, false otherwise |
boolean |
isCanceled()
Returns true if the process state is either ProcessState.PendingCancel or ProcessState.Canceled |
boolean |
isComplete()
Returns true if the process state is either ProcessState.PendingCompletion or ProcessState.Completed |
boolean |
isExecuting()
Returns true if the process state is ProcessState.Executing |
long |
nextTokenId()
|
void |
removeActiveArcToken(ArcToken token)
Removes an ArcToken from the list of active ArcTokens. |
void |
removeActiveNodeToken(NodeToken token)
Removes a NodeToken from the list of active NodeTokens. |
void |
setParentToken(NodeToken parentToken)
|
void |
setState(ProcessState state)
Sets the current ProcessState . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemGraphProcess(Graph graph)
Method Detail |
---|
public void addActiveArcToken(ArcToken token)
GraphProcess
addActiveArcToken
in interface GraphProcess
token
- The token being addedpublic void addActiveNodeToken(NodeToken token)
GraphProcess
addActiveNodeToken
in interface GraphProcess
token
- The token being addedpublic List<NodeToken> getNodeTokens()
GraphProcess
getNodeTokens
in interface GraphProcess
public List<ArcToken> getActiveArcTokens()
GraphProcess
getActiveArcTokens
in interface GraphProcess
public List<NodeToken> getActiveNodeTokens()
GraphProcess
getActiveNodeTokens
in interface GraphProcess
public void addNodeToken(NodeToken token)
GraphProcess
addNodeToken
in interface GraphProcess
token
- The token being addedpublic Env getEnv()
GraphProcess
getEnv
in interface GraphProcess
public Graph getGraph()
GraphProcess
getGraph
in interface GraphProcess
public NodeToken getParentToken()
GraphProcess
NodeToken
and null otherwise.
A nested process is one was started from a different process. The process is
started when a specific node is executed. The node will be in a wait state
while the nested process executes. When the nested process completes, the
node execution will be completed.
getParentToken
in interface GraphProcess
NodeToken
, and null otherwise.public void setParentToken(NodeToken parentToken)
public void removeActiveArcToken(ArcToken token)
GraphProcess
removeActiveArcToken
in interface GraphProcess
token
- The token being removed.public void removeActiveNodeToken(NodeToken token)
GraphProcess
removeActiveNodeToken
in interface GraphProcess
token
- The token being removed.public ArcToken dequeueArcTokenForExecution()
GraphProcess
ArcToken
to execute
dequeueArcTokenForExecution
in interface GraphProcess
ArcToken
to executepublic void enqueueArcTokenForExecution(ArcToken token)
GraphProcess
enqueueArcTokenForExecution
in interface GraphProcess
token
- to enqueuepublic boolean isArcTokenQueueEmpty()
GraphProcess
isArcTokenQueueEmpty
in interface GraphProcess
public ProcessState getState()
GraphProcess
ProcessState
getState
in interface GraphProcess
ProcessState
public void setState(ProcessState state)
GraphProcess
ProcessState
. The state should
be set to ProcessState.Created
by GraphFactory.newProcess(Graph)
.
It should then be set to ProcessState.Executing
by
Engine.startProcess(GraphProcess)
setState
in interface GraphProcess
state
- The new ProcessState
public boolean isCanceled()
GraphProcess
ProcessState.PendingCancel
or ProcessState.Canceled
isCanceled
in interface GraphProcess
ProcessState.PendingCancel
or ProcessState.Canceled
public boolean isComplete()
GraphProcess
ProcessState.PendingCompletion
or ProcessState.Completed
isComplete
in interface GraphProcess
ProcessState.PendingCompletion
or ProcessState.Completed
public boolean isExecuting()
GraphProcess
ProcessState.Executing
isExecuting
in interface GraphProcess
ProcessState.Executing
public boolean hasActiveTokens()
GraphProcess
hasActiveTokens
in interface GraphProcess
public long nextTokenId()
public ExecutionEventQueue getEventQueue()
HasEventQueue
getEventQueue
in interface HasEventQueue
public List<NodeToken> getTokensOnNode(Node node, Engine engine)
GraphProcess
getTokensOnNode
in interface GraphProcess
node
- The node whose tokens we are interested inengine
- The engine that may assist in generating the list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |