Interface FunctionFlowContext<F extends java.lang.Enum<F>>
-
- All Known Subinterfaces:
AdministrationContext<E,F,G>,GovernanceContext<F>,ManagedFunctionContext<O,F>
public interface FunctionFlowContext<F extends java.lang.Enum<F>>Context for theFlowinstances from theManagedFunctionLogic.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsynchronousFlowcreateAsynchronousFlow()Creates anAsynchronousFlowthat must be completed before any furtherFlowis executed.voiddoFlow(int flowIndex, java.lang.Object parameter, FlowCallback callback)Similar todoFlow(Enum, Object, FlowCallback)except that allows dynamic instigation ofFlowinstances.voiddoFlow(F key, java.lang.Object parameter, FlowCallback callback)Instigates aFlowto be run from theManagedFunctionLogic.java.util.concurrent.ExecutorgetExecutor()Obtains theExecutorto run on anotherThread.java.util.logging.LoggergetLogger()Obtains theLogger.
-
-
-
Method Detail
-
getLogger
java.util.logging.Logger getLogger()
Obtains theLogger.- Returns:
Logger.
-
doFlow
void doFlow(F key, java.lang.Object parameter, FlowCallback callback)
Instigates aFlowto be run from theManagedFunctionLogic.- Parameters:
key- Key identifying theFlowto instigate.parameter- Parameter for the firstManagedFunctionof theFlow.callback- OptionalFlowCallback. May benull.
-
doFlow
void doFlow(int flowIndex, java.lang.Object parameter, FlowCallback callback)Similar to
doFlow(Enum, Object, FlowCallback)except that allows dynamic instigation ofFlowinstances.In other words, an
Enumis not required to define the possibleFlowinstances available.- Parameters:
flowIndex- Index identifying theFlowto instigate.parameter- Parameter for the firstManagedFunctionof theFlow.callback- OptionalFlowCallback. May benull.
-
createAsynchronousFlow
AsynchronousFlow createAsynchronousFlow()
Creates anAsynchronousFlowthat must be completed before any furtherFlowis executed.- Returns:
AsynchronousFlowthat must be completed.
-
getExecutor
java.util.concurrent.Executor getExecutor()
Obtains the
Executorto run on anotherThread.Runnableinstances provided to thisExecutorwill always be executed on anotherThread. This allows breaking thread stack execution.Note that the returned
Executoris a singleton perOfficeFloor. Therefore, be careful to not tie up all itsThreadinstances with blocking / long runningRunnableinstances. Preference should be to useManagedFunctioninstances where appropriateThreadinjection can manage execution.- Returns:
Executorto runRunnableon anotherThread.
-
-