Interface ManagedObjectExecuteContext<F extends java.lang.Enum<F>>
-
public interface ManagedObjectExecuteContext<F extends java.lang.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 newProcessState
which for example will cause newManagedObject
dependencies to be instantiated. - The
ManagedObject
passed to the invocation will go through a full life-cycle so be careful passing in an existing initialisedManagedObject
. For example theAsynchronousContext
instance 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
- The
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addService(ManagedObjectService<F> service)
Adds aManagedObjectService
.java.util.concurrent.ThreadFactory[]
getExecutionStrategy(int executionStrategyIndex)
Obtains anExecutionStrategy
.java.util.logging.Logger
getLogger()
Obtains theLogger
.ManagedObjectStartupProcess
invokeStartupProcess(int flowIndex, java.lang.Object parameter, ManagedObject managedObject, FlowCallback callback)
Invokes a start upFlow
.ManagedObjectStartupProcess
invokeStartupProcess(F key, java.lang.Object parameter, ManagedObject managedObject, FlowCallback callback)
Invokes a start upFlow
.
-
-
-
Method Detail
-
getLogger
java.util.logging.Logger getLogger()
Obtains theLogger
.- Returns:
Logger
.
-
getExecutionStrategy
java.util.concurrent.ThreadFactory[] getExecutionStrategy(int executionStrategyIndex)
Obtains anExecutionStrategy
.- Parameters:
executionStrategyIndex
- Index of theExecutionStrategy
.- Returns:
ThreadFactory
instances for theExecutionStrategy
.
-
invokeStartupProcess
ManagedObjectStartupProcess invokeStartupProcess(F key, java.lang.Object parameter, ManagedObject managedObject, FlowCallback callback) throws java.lang.IllegalArgumentException
Invokes a start upFlow
.- Parameters:
key
- Key identifying theFlow
to instigate.parameter
- Parameter to firstManagedFunction
of theFlow
.managedObject
-ManagedObject
for theProcessState
of theFlow
.callback
-FlowCallback
on completion of theFlow
.- Returns:
ManagedObjectStartupProcess
.- Throws:
java.lang.IllegalArgumentException
- If- unknown
Flow
key - parameter is incorrect type
- no
ManagedObject
is supplied
- unknown
-
invokeStartupProcess
ManagedObjectStartupProcess invokeStartupProcess(int flowIndex, java.lang.Object parameter, ManagedObject managedObject, FlowCallback callback) throws java.lang.IllegalArgumentException
Invokes a start upFlow
.- Parameters:
flowIndex
- Index identifying theFlow
to instigate.parameter
- Parameter to firstManagedFunction
of theFlow
.managedObject
-ManagedObject
for theProcessState
of theFlow
.callback
-FlowCallback
on completion of theFlow
.- Returns:
ManagedObjectStartupProcess
.- Throws:
java.lang.IllegalArgumentException
- If- unknown
Flow
key - parameter is incorrect type
- no
ManagedObject
is supplied
- unknown
-
addService
void addService(ManagedObjectService<F> service)
Adds aManagedObjectService
.- Parameters:
service
-ManagedObjectService
.
-
-