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 theManagedFunction
is done.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
doFlow(java.lang.String functionName, java.lang.Object parameter, FlowCallback callback)
java.lang.Object
getObject(int dependencyIndex)
Similar togetObject(Enum)
except allows dynamically obtaining the dependencies.java.lang.Object
getObject(O key)
Obtains the dependency object.void
setNextFunctionArgument(java.lang.Object argument)
Specifies the nextManagedFunction
argument.-
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
Enum
is 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, InvalidParameterTypeException
Invokes a
Flow
by dynamically naming the initialManagedFunction
of 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
ManagedFunction
reflective meta-data may be obtained from theOffice
made available via theOfficeAwareManagedFunctionFactory
.- Parameters:
functionName
- Name ofManagedFunction
within theOffice
.parameter
- Parameter to the task. May benull
.callback
- OptionalFlowCallback
that is invoked on completion of theFlow
.- Throws:
UnknownFunctionException
- Should noManagedFunction
be in theOffice
by the name.InvalidParameterTypeException
- Should the parameter be an invalid type for theManagedFunction
.
-
setNextFunctionArgument
void setNextFunctionArgument(java.lang.Object argument) throws java.lang.Exception
Specifies the nextManagedFunction
argument.- Parameters:
argument
- Argument for the nextManagedFunction
.- Throws:
java.lang.Exception
- If invalid argument. Typically this is not a recoverable exception, so let propagate from theManagedFunction
orAsynchronousFlowCompletion
.
-
-