Class TaskRequest

All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resettable, Stateful, Stoppable

public class TaskRequest extends SerializableJob implements Stoppable
Author:
Rob
See Also:

Description

This job requests a task be performed with optional properties.

Example

Greeting people by name. Three Task Requests call the TaskExecutionService 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>
  • Constructor Details

    • TaskRequest

      public TaskRequest()
  • Method Details

    • setTaskExecutor

      public void setTaskExecutor(TaskExecutor node)
      Set the stop node directly.
      Parameters:
      node - The job.
    • getTaskExecutor

      public TaskExecutor getTaskExecutor()
      Get the job.
      Returns:
      The node.
    • execute

      protected int execute() throws Exception
      Description copied from class: SimpleJob
      Execute this job.
      Specified by:
      execute in class SimpleJob
      Returns:
      0 if the job is complete, anything else otherwise.
      Throws:
      Exception - If the unexpected occurs.
    • onStop

      protected void onStop() throws FailedToStopException
      Description copied from class: SimpleJob
      Allow sub classes to do something on stop.
      Overrides:
      onStop in class SimpleJob
      Throws:
      FailedToStopException
    • isJoin

      public boolean isJoin()
    • setJoin

      public void setJoin(boolean join)
    • getProperties

      public Properties getProperties()
    • setProperties

      public void setProperties(Properties properties)
    • getResponse

      public Object getResponse()