public class TaskExecutionService extends SimpleService implements TaskExecutor, Structural
The task to be executed is defined by the nested jobs which may use the properties. which will be defined when executing the tasks.
This implementation only supports the single execution of a task at one time. If the task is running additional requests to execute the task will be ignored.
Future version will support multiple parallel executions of tasks.
TaskRequests call the
service with different names.
<oddjob>
<job>
<sequential>
<jobs>
<task-service id="hello-service">
<requests>
<input-text prompt="Name" property="some.name"/>
</requests>
<job>
<echo>Hello ${some.name}.</echo>
</job>
</task-service>
<task-request taskExecutor="${hello-service}">
<properties>
<properties>
<values>
<value key="some.name" value="Rod"/>
</values>
</properties>
</properties>
</task-request>
<task-request taskExecutor="${hello-service}">
<properties>
<properties>
<values>
<value key="some.name" value="Jane"/>
</values>
</properties>
</properties>
</task-request>
<task-request taskExecutor="${hello-service}">
<properties>
<properties>
<values>
<value key="some.name" value="Freddy"/>
</values>
</properties>
</properties>
</task-request>
</jobs>
</sequential>
</job>
</oddjob>
| Modifier and Type | Field and Description |
|---|---|
protected ChildHelper<java.lang.Object> |
childHelper
Track changes to children an notify listeners.
|
| Constructor and Description |
|---|
TaskExecutionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStructuralListener(StructuralListener listener)
Add a listener.
|
TaskView |
execute(Task task)
Execute a task.
|
InputRequest[] |
getParameterInfo()
Provide the Parameter meta info for the task.
|
java.util.Properties |
getProperties() |
InputRequest |
getRequests(int index) |
ResetAction |
getReset() |
java.lang.String |
getResponse() |
protected void |
onStart() |
protected void |
onStop()
Allow sub classes to do something on stop.
|
void |
removeStructuralListener(StructuralListener listener)
Remove a listener.
|
void |
setArooaSession(ArooaSession session)
Here for the tests...
|
void |
setJob(java.lang.Object job) |
void |
setRequests(int index,
InputRequest request) |
void |
setReset(ResetAction resetAction) |
void |
setResponse(java.lang.String responseExpression) |
fireDestroyedState, getName, getStateChanger, hardReset, iconHelper, logger, loggerName, onDestroy, run, setName, softReset, stateHandler, stop, toStringaddIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, save, setArooaContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddStateListener, lastStateEvent, removeStateListenerprotected final ChildHelper<java.lang.Object> childHelper
public void setArooaSession(ArooaSession session)
BaseComponentsetArooaSession in interface ArooaSessionAwaresetArooaSession in class BaseComponentsession - The Arooa Session. Never null.public InputRequest getRequests(int index)
public void setRequests(int index,
InputRequest request)
public InputRequest[] getParameterInfo()
TaskExecutorgetParameterInfo in interface TaskExecutorpublic TaskView execute(Task task) throws TaskException
TaskExecutorexecute in interface TaskExecutorTaskExceptionprotected void onStart()
throws java.lang.Throwable
onStart in class SimpleServicejava.lang.Exceptionjava.lang.Throwableprotected void onStop()
throws FailedToStopException
SimpleServiceonStop in class SimpleServiceFailedToStopExceptionpublic void addStructuralListener(StructuralListener listener)
addStructuralListener in interface Structurallistener - The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener in interface Structurallistener - The listener.public void setJob(java.lang.Object job)
Property: job
Description: The job to pass resets on to.
Required: Yes.
public ResetAction getReset()
public void setReset(ResetAction resetAction)
public java.util.Properties getProperties()
public java.lang.String getResponse()
public void setResponse(java.lang.String responseExpression)