|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.officefloor.frame.impl.spi.team.ProcessContextTeam
public class ProcessContextTeam
Team to re-use the invoking Thread of the
ProcessState. Typically this will be the Thread invoking the
Work via the WorkManager.
To enable the invoking Thread to be available for executing
Task instances of the ProcessState, the Work by the
WorkManager needs to be invoked with the
doWork(WorkManager, Object) method.
As the typical focus of this Team is to integration with Application
Servers (using correct Thread for JNDI lookups), assigned Job
instances without a ProcessState context Thread will be
executed passively (i.e. by the caller - Thread of previous
Job).
| Constructor Summary | |
|---|---|
ProcessContextTeam(TeamIdentifier teamIdentifier)
Initiate. |
|
| Method Summary | ||
|---|---|---|
void |
assignJob(Job job,
TeamIdentifier assignerTeam)
Assigns a Job to be executed by this Team. |
|
static void |
doProcess(ManagedObjectExecuteContext<?> executeContext,
int flowIndex,
Object parameter,
ManagedObject managedObject,
EscalationHandler escalationHandler)
Wrap invoking ProcessState on the
ManagedObjectExecuteContext to allow the Thread to be
available to execute the Task instances of the
ProcessState. |
|
static
|
doProcess(ManagedObjectExecuteContext<F> executeContext,
F flowKey,
Object parameter,
ManagedObject managedObject,
EscalationHandler escalationHandler)
Wrap invoking ProcessState on the
ManagedObjectExecuteContext to allow the Thread to be
available to execute the Task instances of the
ProcessState. |
|
static void |
doTask(TaskManager taskManager,
Object parameter)
Wrap invoking Task on the TaskManager to allow the
Thread to be available to execute the Task instances of
the ProcessState. |
|
static void |
doWork(WorkManager workManager,
Object parameter)
Wrap invoking Work on the WorkManager to allow the
Thread to be available to execute the Task instances of
the ProcessState. |
|
void |
processCompleted(Object processIdentifier)
Notifies that the ProcessState is completed. |
|
void |
processCreated(Object processIdentifier)
Notifies that a ProcessState is created. |
|
void |
startWorking()
Indicates for the Team to start working. |
|
void |
stopWorking()
Indicates for the Team to stop working. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessContextTeam(TeamIdentifier teamIdentifier)
teamIdentifier - TeamIdentifier of this Team.| Method Detail |
|---|
public static void doWork(WorkManager workManager,
Object parameter)
throws NoInitialTaskException,
InvalidParameterTypeException,
InterruptedException
Wrap invoking Work on the WorkManager to allow the
Thread to be available to execute the Task instances of
the ProcessState.
This method blocks until the invoked ProcessState of the invoked
Work is complete.
workManager - WorkManager managing the Work to invoked.parameter - Parameter for the initial Task of the Work.
NoInitialTaskException - If Work of the WorkManager has no initial
Task.
InvalidParameterTypeException - Should the parameter type be invalid for the Task.
InterruptedException - Should this blocking call be interrupted.
public static void doTask(TaskManager taskManager,
Object parameter)
throws InvalidParameterTypeException,
InterruptedException
Wrap invoking Task on the TaskManager to allow the
Thread to be available to execute the Task instances of
the ProcessState.
This method blocks until the invoked ProcessState of the invoked
Task is complete.
taskManager - TaskManager managing the Task to invoked.parameter - Parameter for the Task.
InvalidParameterTypeException - Should the parameter type be invalid for the Task.
InterruptedException - Should this blocking call be interrupted.
public static <F extends Enum<F>> void doProcess(ManagedObjectExecuteContext<F> executeContext,
F flowKey,
Object parameter,
ManagedObject managedObject,
EscalationHandler escalationHandler)
throws InterruptedException
Wrap invoking ProcessState on the
ManagedObjectExecuteContext to allow the Thread to be
available to execute the Task instances of the
ProcessState.
This method blocks until the invoked ProcessState is complete.
executeContext - ManagedObjectExecuteContext.flowKey - JobSequence key.parameter - Parameter for the initial Task.managedObject - ManagedObject.escalationHandler - EscalationHandler. May be null.
InterruptedException - Should this blocking call be interrupted.
public static void doProcess(ManagedObjectExecuteContext<?> executeContext,
int flowIndex,
Object parameter,
ManagedObject managedObject,
EscalationHandler escalationHandler)
throws InterruptedException
Wrap invoking ProcessState on the
ManagedObjectExecuteContext to allow the Thread to be
available to execute the Task instances of the
ProcessState.
This method blocks until the invoked ProcessState is complete.
executeContext - ManagedObjectExecuteContext.flowIndex - JobSequence index.parameter - Parameter for the initial Task.managedObject - ManagedObject.escalationHandler - EscalationHandler. May be null.
InterruptedException - Should this blocking call be interrupted.public void startWorking()
TeamTeam to start working.
startWorking in interface Team
public void assignJob(Job job,
TeamIdentifier assignerTeam)
TeamJob to be executed by this Team.
assignJob in interface Teamjob - Job.assignerTeam - TeamIdentifier of the Team assigning the
Job to this Team.public void stopWorking()
Team
Indicates for the Team to stop working.
This method should block and only return control when the Team
has stopped working and is no longer assigned Job instances to
complete.
stopWorking in interface Teampublic void processCreated(Object processIdentifier)
ProcessContextListener
Notifies that a ProcessState is created.
This will be invoked by the same Thread creating the
ProcessState.
processCreated in interface ProcessContextListenerprocessIdentifier - ProcessState identifier.public void processCompleted(Object processIdentifier)
ProcessContextListenerProcessState is completed.
processCompleted in interface ProcessContextListenerprocessIdentifier - ProcessState identifier.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||