|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gridsystems.nextgrid.api.pom.PemHelper
com.gridsystems.nextgrid.api.pom.ProcessImpl
com.gridsystems.nextgrid.api.pom.AbstractProcessImpl
public final class AbstractProcessImpl
A process with a semantic description, but no specific implementation binding details.
Such an abstract process must be fulfilled with binding information or "replaced" by a more specific, yet still abstract, process during enaction. This replacement is really implemented through a child containment structure to prevent losing original semantic data: In case of error, the enactor must be able to revert to the original abstract description and repeat the discovery phase to reach an alternative service provider.
The presence of instances of this class within a workflow representation as leaf nodes marks this workflow as abstract, meaning that it will require some extra process before being "executable".
In OWL-WS terms, an AbstractProcessImpl can be mapped to a service that only contains a profile, but no grounding; that is, it only states service constraints, but no capabilities.
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 |
Fields inherited from interface nextgrid.api.pom.AbstractProcess |
---|
UNDEFINED_PRIORITY |
Constructor Summary | |
---|---|
AbstractProcessImpl()
Creates an instance. |
|
AbstractProcessImpl(nextgrid.api.pom.QueryProfile profile)
Creates a new instance. |
Method Summary | |
---|---|
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. |
protected void |
doReset()
Performs specific reset actions in each subclass. |
protected void |
doValidate(ProcessImpl.ValidationType when)
Performs any validation action needed for the process implementation. |
nextgrid.api.pom.Process |
findProcessById(java.net.URI id)
|
java.util.List<nextgrid.api.pom.Process> |
getCandidates()
|
int |
getPriority()
Gets the priority (evaluation order) of this process. |
nextgrid.api.pom.QueryProfile |
getProfile()
|
nextgrid.api.pom.Process |
getSelected()
|
void |
prioritise(nextgrid.api.env.ProcessEnvironment env,
java.util.PriorityQueue<nextgrid.api.pom.Process> queue)
|
protected void |
resetChildren()
Resets any child process. |
void |
run(ProcessContext ctx)
Performs the actual enaction of a process. |
void |
setCandidates(java.util.Collection<nextgrid.api.pom.Process> candidates)
|
void |
setPriority(int priority)
Sets the priority (evaluation order) of this process. |
void |
setProfile(nextgrid.api.pom.QueryProfile profile)
|
void |
setSelected(nextgrid.api.pom.Process selected)
Sets the selected process. |
java.lang.String |
toString()
|
Methods inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl |
---|
attachListeners, 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, wait, wait, wait |
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, isLazy, isValidated, putInput, putOutput, removeInput, removeListener, removeOutput, reset, setAttribute, setAttribute, setDescription, setId, setLazy, setName, setParent, unuseInput, unuseOutput, useInput, useOutput, validate |
Constructor Detail |
---|
public AbstractProcessImpl()
public AbstractProcessImpl(nextgrid.api.pom.QueryProfile profile)
profile
- The query profile that defines this processMethod Detail |
---|
public java.util.List<nextgrid.api.pom.Process> getCandidates()
getCandidates
in interface nextgrid.api.pom.AbstractProcess
public void setCandidates(java.util.Collection<nextgrid.api.pom.Process> candidates)
setCandidates
in interface nextgrid.api.pom.AbstractProcess
public nextgrid.api.pom.Process getSelected()
getSelected
in interface nextgrid.api.pom.AbstractProcess
public void setSelected(nextgrid.api.pom.Process selected)
setSelected
in interface nextgrid.api.pom.AbstractProcess
selected
- The new selected processpublic int getPriority()
getPriority
in interface nextgrid.api.pom.AbstractProcess
public void setPriority(int priority)
setPriority
in interface nextgrid.api.pom.AbstractProcess
priority
- The new priority valuepublic nextgrid.api.pom.QueryProfile getProfile()
getProfile
in interface nextgrid.api.pom.AbstractProcess
public void setProfile(nextgrid.api.pom.QueryProfile profile)
setProfile
in interface nextgrid.api.pom.AbstractProcess
public nextgrid.api.pom.Process findProcessById(java.net.URI id)
findProcessById
in interface nextgrid.api.pom.Process
protected void doValidate(ProcessImpl.ValidationType when) throws nextgrid.api.pom.ProcessException
doValidate
in class ProcessImpl
when
- Specifies when this validation is being invoked
nextgrid.api.pom.ProcessException
- If the validation failspublic 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 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
protected void doReset()
doReset
in class ProcessImpl
protected void resetChildren()
resetChildren
in class ProcessImpl
public void run(ProcessContext ctx) throws nextgrid.api.pom.ProcessException, java.lang.InterruptedException
The instance must take into account possible errors, like service unavailability, or execution errors. As long as there are more "valid" candidates for the process, errors should not be propagated to the parent, and the next candidate should be selected and enacted.
A ProcessException as a result of this call means that this process is unable to correctly finish its execution, and that the parent must do something to fix the problem.
run
in interface Enactable
ctx
- A process context
nextgrid.api.pom.ProcessException
- If an unrecoverable local error occurs
java.lang.InterruptedException
- If the thread is interruptedpublic java.lang.String toString()
toString
in class java.lang.Object
public nextgrid.api.pom.Process copy()
copy
in interface nextgrid.api.pom.Process
copy
in class ProcessImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |