Interface ManagedObjectExecuteContext<F extends Enum<F>>
public interface ManagedObjectExecuteContext<F extends Enum<F>>
Context that the ManagedObject is to execute within.
In invoking processes the following should be taken into account:
- The
Flow(process) will be instigated in a newProcessStatewhich for example will cause newManagedObjectdependencies to be instantiated. - The
ManagedObjectpassed to the invocation will go through a full life-cycle so be careful passing in an existing initialisedManagedObject. For example theAsynchronousContextinstance will be overwritten which will likely cause live-lock as theAsynchronousContext.complete(net.officefloor.frame.api.managedobject.AsynchronousOperation)will notify on the wrongManagedObjectContainer.
- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddService(ManagedObjectService<F> service) Adds aManagedObjectService.getExecutionStrategy(int executionStrategyIndex) Obtains anExecutionStrategy.Obtains theLogger.invokeStartupProcess(int flowIndex, Object parameter, ManagedObject managedObject, FlowCallback callback) Invokes a start upFlow.invokeStartupProcess(F key, Object parameter, ManagedObject managedObject, FlowCallback callback) Invokes a start upFlow.
-
Method Details
-
getLogger
Logger getLogger()Obtains theLogger.- Returns:
Logger.
-
getExecutionStrategy
Obtains anExecutionStrategy.- Parameters:
executionStrategyIndex- Index of theExecutionStrategy.- Returns:
ThreadFactoryinstances for theExecutionStrategy.
-
invokeStartupProcess
ManagedObjectStartupProcess invokeStartupProcess(F key, Object parameter, ManagedObject managedObject, FlowCallback callback) throws IllegalArgumentException Invokes a start upFlow.- Parameters:
key- Key identifying theFlowto instigate.parameter- Parameter to firstManagedFunctionof theFlow.managedObject-ManagedObjectfor theProcessStateof theFlow.callback-FlowCallbackon completion of theFlow.- Returns:
ManagedObjectStartupProcess.- Throws:
IllegalArgumentException- If- unknown
Flowkey - parameter is incorrect type
- no
ManagedObjectis supplied
- unknown
-
invokeStartupProcess
ManagedObjectStartupProcess invokeStartupProcess(int flowIndex, Object parameter, ManagedObject managedObject, FlowCallback callback) throws IllegalArgumentException Invokes a start upFlow.- Parameters:
flowIndex- Index identifying theFlowto instigate.parameter- Parameter to firstManagedFunctionof theFlow.managedObject-ManagedObjectfor theProcessStateof theFlow.callback-FlowCallbackon completion of theFlow.- Returns:
ManagedObjectStartupProcess.- Throws:
IllegalArgumentException- If- unknown
Flowkey - parameter is incorrect type
- no
ManagedObjectis supplied
- unknown
-
addService
Adds aManagedObjectService.- Parameters:
service-ManagedObjectService.
-