Interface ManagedFunctionContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
-
- All Superinterfaces:
FunctionFlowContext<F>
public interface ManagedFunctionContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> extends FunctionFlowContext<F>
Context in which theManagedFunctionis done.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddoFlow(java.lang.String functionName, java.lang.Object parameter, FlowCallback callback)java.lang.ObjectgetObject(int dependencyIndex)Similar togetObject(Enum)except allows dynamically obtaining the dependencies.java.lang.ObjectgetObject(O key)Obtains the dependency object.voidsetNextFunctionArgument(java.lang.Object argument)Specifies the nextManagedFunctionargument.-
Methods inherited from interface net.officefloor.frame.api.function.FunctionFlowContext
createAsynchronousFlow, doFlow, doFlow, getExecutor, getLogger
-
-
-
-
Method Detail
-
getObject
java.lang.Object getObject(O key)
Obtains the dependency object.- Parameters:
key- Key identifying the dependency.- Returns:
- Dependency object.
-
getObject
java.lang.Object getObject(int dependencyIndex)
Similar to
getObject(Enum)except allows dynamically obtaining the dependencies.In other words, an
Enumis not required to define the possible dependencies available.- Parameters:
dependencyIndex- Index identifying the dependency.- Returns:
- Dependency object.
-
doFlow
void doFlow(java.lang.String functionName, java.lang.Object parameter, FlowCallback callback) throws UnknownFunctionException, InvalidParameterTypeExceptionInvokes a
Flowby dynamically naming the initialManagedFunctionof theFlow.This method should not be preferred, as the other
doFlow(...)methods are compile safe. This method however provides the similar functionality as per reflection - powerful yet compile unsafe.The
ManagedFunctionreflective meta-data may be obtained from theOfficemade available via theOfficeAwareManagedFunctionFactory.- Parameters:
functionName- Name ofManagedFunctionwithin theOffice.parameter- Parameter to the task. May benull.callback- OptionalFlowCallbackthat is invoked on completion of theFlow.- Throws:
UnknownFunctionException- Should noManagedFunctionbe in theOfficeby the name.InvalidParameterTypeException- Should the parameter be an invalid type for theManagedFunction.
-
setNextFunctionArgument
void setNextFunctionArgument(java.lang.Object argument) throws java.lang.ExceptionSpecifies the nextManagedFunctionargument.- Parameters:
argument- Argument for the nextManagedFunction.- Throws:
java.lang.Exception- If invalid argument. Typically this is not a recoverable exception, so let propagate from theManagedFunctionorAsynchronousFlowCompletion.
-
-