|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gridsystems.nextgrid.api.pom.PemHelper com.gridsystems.nextgrid.api.pom.ProcessImpl com.gridsystems.nextgrid.api.pom.ControlProcessImpl
public abstract class ControlProcessImpl
Control Process.
A control process is a process container that adds implicit execution flow constraints to its children processes. These constraints may be implemented through dependencies among the processes.
In addition to this, a control process can introduce "hints" that the enactor may use to drive the evaluation process. For example, a conditional control structure may instruct the enactor to only evaluate a subset of its branches for considering it as valid.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl |
---|
ProcessImpl.ValidationType |
Field Summary |
---|
Fields inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl |
---|
DFA_INITIAL_STATE, ENACTOR_LOG |
Constructor Summary | |
---|---|
protected |
ControlProcessImpl(int maxChildren)
Creates a new instance. |
Method Summary | |
---|---|
void |
addChildren(int index,
nextgrid.api.pom.Process child)
Inserts the specified element at the specified position in this list. |
void |
addChildren(nextgrid.api.pom.Process... processes)
Adds a set of processes to the child list. |
nextgrid.api.pom.Process |
copy()
|
void |
discover(nextgrid.api.env.ProcessEnvironment env)
|
void |
doEvaluate(nextgrid.api.env.ProcessEnvironment env)
Performs the actual actions needed for evaluating this process instance. |
nextgrid.api.pom.Process |
findProcessById(java.net.URI id)
|
int |
getChildCount()
Gets the number of child processes. |
nextgrid.api.pom.Process[] |
getChildren()
Gets the processes in the children list. |
nextgrid.api.pom.Process |
getChildren(int index)
Gets a child process by its index. |
nextgrid.api.pom.Reference<?> |
getLocalVar(java.lang.String name)
|
java.util.Map<java.lang.String,nextgrid.api.pom.Reference<?>> |
getLocalVars()
|
boolean |
isMemoizeActive()
|
void |
prioritise(nextgrid.api.env.ProcessEnvironment env,
java.util.PriorityQueue<nextgrid.api.pom.Process> queue)
|
nextgrid.api.pom.Process |
removeChild(int index)
Removes the element at the specified position in this list. |
boolean |
removeChild(nextgrid.api.pom.Process child)
Removes a process instance from the children list. |
protected void |
resetChildren()
Resets all child processes. |
void |
setChildren(int index,
nextgrid.api.pom.Process child)
Sets a child process. |
void |
setChildren(nextgrid.api.pom.Process... children)
Sets the list of child processes for this process instance. |
void |
setLocalVar(java.lang.String name,
nextgrid.api.pom.Reference<?> value)
|
void |
setMemoizeActive(boolean memoizeActive)
|
void |
trim(int count)
Sets the size of the children list to a maximum of count items. |
Methods inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl |
---|
attachListeners, doReset, doValidate, enact, evaluate, evaluate, findRoot, getAttribute, getAttribute, getAttribute, getAttributes, getDescription, getId, getInput, getInputs, getInputs, getInputType, getName, getOutput, getOutputs, getOutputs, getOutputType, getParent, getState, getUsedInputNames, getUsedOutputNames, invalidate, isEvaluated, isLazy, isValidated, prioritise, putInput, putOutput, removeInput, removeOutput, reset, setAttribute, setAttribute, setDescription, setEvaluated, setId, setLazy, setName, setParent, setState, unuseInput, unuseOutput, useInput, useOutput, validate, waitForInputs |
Methods inherited from class com.gridsystems.nextgrid.api.pom.PemHelper |
---|
addListener, fireDiscovererSelected, fireDiscoveryFailed, fireDiscoveryFinished, fireDiscoveryStarting, fireEvent, fireProcessEvaluated, fireProcessFailed, fireProcessFailed, fireProcessFinished, fireProcessFinished, fireProcessSelected, fireProcessStarted, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nextgrid.api.pom.ControlProcess |
---|
isLazy, setLazy |
Methods inherited from interface nextgrid.api.pom.Process |
---|
addListener, enact, evaluate, findRoot, getAttribute, getAttribute, getAttribute, getAttributes, getDescription, getId, getInput, getInputs, getInputType, getName, getOutput, getOutputs, getOutputType, getParent, getUsedInputNames, getUsedOutputNames, invalidate, isEvaluated, isValidated, putInput, putOutput, removeInput, removeListener, removeOutput, reset, setAttribute, setAttribute, setDescription, setId, setName, setParent, unuseInput, unuseOutput, useInput, useOutput, validate |
Methods inherited from interface com.gridsystems.nextgrid.api.pom.Enactable |
---|
run |
Constructor Detail |
---|
protected ControlProcessImpl(int maxChildren)
maxChildren
- The max number of supported children processesMethod Detail |
---|
public final nextgrid.api.pom.Process findProcessById(java.net.URI id)
findProcessById
in interface nextgrid.api.pom.Process
public final void prioritise(nextgrid.api.env.ProcessEnvironment env, java.util.PriorityQueue<nextgrid.api.pom.Process> queue) throws nextgrid.api.pom.ProcessException
prioritise
in interface nextgrid.api.pom.Process
nextgrid.api.pom.ProcessException
public void discover(nextgrid.api.env.ProcessEnvironment env) throws nextgrid.api.pom.ProcessException
discover
in interface nextgrid.api.pom.Process
nextgrid.api.pom.ProcessException
public final void doEvaluate(nextgrid.api.env.ProcessEnvironment env) throws nextgrid.api.pom.ProcessException
doEvaluate
in class ProcessImpl
env
- The process environment
nextgrid.api.pom.ProcessException
- If an error occurspublic final boolean isMemoizeActive()
isMemoizeActive
in interface nextgrid.api.pom.ControlProcess
public final void setMemoizeActive(boolean memoizeActive)
setMemoizeActive
in interface nextgrid.api.pom.ControlProcess
public final nextgrid.api.pom.Process[] getChildren()
getChildren
in interface nextgrid.api.pom.ControlProcess
public final nextgrid.api.pom.Process getChildren(int index)
getChildren
in interface nextgrid.api.pom.ControlProcess
index
- The child process position
public final int getChildCount()
getChildCount
in interface nextgrid.api.pom.ControlProcess
public final void trim(int count)
It correctly removes all items from position count to the end of the list. If the list is already smaller than count, it does nothing.
trim
in interface nextgrid.api.pom.ControlProcess
count
- The max number of elements to maintain in the children listpublic final void setChildren(nextgrid.api.pom.Process... children)
setChildren
in interface nextgrid.api.pom.ControlProcess
children
- An array of processespublic final void setChildren(int index, nextgrid.api.pom.Process child)
setChildren
in interface nextgrid.api.pom.ControlProcess
index
- The position in the listchild
- The process to set
java.lang.UnsupportedOperationException
- If the process does not support childrenpublic final void addChildren(int index, nextgrid.api.pom.Process child)
addChildren
in interface nextgrid.api.pom.ControlProcess
index
- index at which the specified element is to be inserted.child
- element to be inserted.
java.lang.UnsupportedOperationException
- if the add method is not supported by this list.
java.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this list.
java.lang.IllegalArgumentException
- if some aspect of the specified element prevents it from being
added to this list.
java.lang.IndexOutOfBoundsException
- index is out of range (index < 0 || index > size()).public final void addChildren(nextgrid.api.pom.Process... processes)
addChildren
in interface nextgrid.api.pom.ControlProcess
processes
- The processes to addpublic final nextgrid.api.pom.Process removeChild(int index)
removeChild
in interface nextgrid.api.pom.ControlProcess
index
- the index of the element to remove
java.lang.UnsupportedOperationException
- if the remove method is not supported by this list.
java.lang.IndexOutOfBoundsException
- if the specified index is out of range (index < 0 ||
index >= size()).public final boolean removeChild(nextgrid.api.pom.Process child)
removeChild
in interface nextgrid.api.pom.ControlProcess
child
- The process to remove
public final nextgrid.api.pom.Reference<?> getLocalVar(java.lang.String name)
getLocalVar
in interface nextgrid.api.pom.ControlProcess
public final void setLocalVar(java.lang.String name, nextgrid.api.pom.Reference<?> value)
setLocalVar
in interface nextgrid.api.pom.ControlProcess
public final java.util.Map<java.lang.String,nextgrid.api.pom.Reference<?>> getLocalVars()
getLocalVars
in interface nextgrid.api.pom.ControlProcess
public nextgrid.api.pom.Process copy()
copy
in interface nextgrid.api.pom.Process
copy
in class ProcessImpl
protected final void resetChildren()
This method can be used by loop constructs to prepare each iteration.
resetChildren
in class ProcessImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |