Class TaskExecutionService

All Implemented Interfaces:
Runnable, ArooaContextAware, ArooaSessionAware, PropertyChangeNotifier, Iconic, TaskExecutor, LogEnabled, Resettable, Stateful, Stoppable, Structural

public class TaskExecutionService extends SimpleService implements TaskExecutor, Structural
Author:
Rob Gordon

Description

Provide a very simple task execution service.

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.

Example

A Task Service that greets people by name. Three 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>