net.officefloor.frame.impl.execute.office
Class WorkManagerImpl

java.lang.Object
  extended by net.officefloor.frame.impl.execute.office.WorkManagerImpl
All Implemented Interfaces:
WorkManager

public class WorkManagerImpl
extends Object
implements WorkManager

Implementation of the WorkManager.

Author:
Daniel Sagenschneider

Constructor Summary
WorkManagerImpl(WorkMetaData<?> workMetaData, OfficeMetaData officeMetaData, ProcessTicker processTicker)
          Initiate.
 
Method Summary
 TaskManager getTaskManager(String taskName)
          Obtains the TaskManager for the named Task.
 String[] getTaskNames()
           Obtains the names of the TaskManager instances managed by this WorkManager.
 Class<?> getWorkParameterType()
          Obtains the parameter type for invoking the Work.
 ProcessFuture invokeWork(Object parameter)
          Invokes a new instance of Work which is done within the Office.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkManagerImpl

public WorkManagerImpl(WorkMetaData<?> workMetaData,
                       OfficeMetaData officeMetaData,
                       ProcessTicker processTicker)
Initiate.

Parameters:
workMetaData - WorkMetaData.
officeMetaData - OfficeMetaData.
processTicker - ProcessTicker.
Method Detail

getWorkParameterType

public Class<?> getWorkParameterType()
                              throws NoInitialTaskException
Description copied from interface: WorkManager
Obtains the parameter type for invoking the Work.

Specified by:
getWorkParameterType in interface WorkManager
Returns:
Parameter type for invoking the Work. Will be null if no parameter to the Work.
Throws:
NoInitialTaskException - If Work does not have an initial Task.

invokeWork

public ProcessFuture invokeWork(Object parameter)
                         throws NoInitialTaskException,
                                InvalidParameterTypeException
Description copied from interface: WorkManager
Invokes a new instance of Work which is done within the Office.

Specified by:
invokeWork in interface WorkManager
Parameters:
parameter - Parameter for the first Task of the Work.
Returns:
ProcessFuture to indicate when the ProcessState executing the Work has completed.
Throws:
NoInitialTaskException - If Work does not have an initial Task.
InvalidParameterTypeException - Should the parameter be of incorrect type for the initial Task.

getTaskNames

public String[] getTaskNames()
Description copied from interface: WorkManager

Obtains the names of the TaskManager instances managed by this WorkManager.

This allows to dynamically manage this WorkManager.

Specified by:
getTaskNames in interface WorkManager
Returns:
Names of the TaskManager instances managed by this WorkManager.

getTaskManager

public TaskManager getTaskManager(String taskName)
                           throws UnknownTaskException
Description copied from interface: WorkManager
Obtains the TaskManager for the named Task.

Specified by:
getTaskManager in interface WorkManager
Returns:
TaskManager for the named Task.
Throws:
UnknownTaskException - If unknown Task name.


Copyright © 2005-2013. All Rights Reserved.