Package net.officefloor.frame.test
Class ReflectiveFunctionBuilder
- java.lang.Object
-
- net.officefloor.frame.api.function.StaticManagedFunction<Indexed,Indexed>
-
- net.officefloor.frame.test.ReflectiveFunctionBuilder
-
- All Implemented Interfaces:
ManagedFunction<Indexed,Indexed>,ManagedFunctionFactory<Indexed,Indexed>
public class ReflectiveFunctionBuilder extends StaticManagedFunction<Indexed,Indexed>
ReflectiveManagedFunctionBuilder.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ReflectiveFunctionBuilder(java.lang.Class<C> clazz, C object, java.lang.String methodName, OfficeBuilder officeBuilder, ConstructTestSupport constructTestSupport)Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildAsynchronousFlow()BuildsAsynchronousFlow.voidbuildFlow(java.lang.String functionName, java.lang.Class<?> argumentType, boolean isSpawnThreadState)Builds the flow.voidbuildManagedFunctionContext()Builds theManagedFunctionContext.voidbuildObject(java.lang.String scopeManagedObjectName)Links theManagedObjectto theManagedFunction.DependencyMappingBuilderbuildObject(java.lang.String officeManagedObjectName, ManagedObjectScope managedObjectScope)Builds theManagedObjectScopeboundManagedObject.voidbuildParameter()Builds the parameter.voidexecute(ManagedFunctionContext<Indexed,Indexed> context)Executes the function.ManagedFunctionBuilder<Indexed,Indexed>getBuilder()Obtains theManagedFunctionBuilder.ReflectiveAdministrationBuilderpostAdminister(java.lang.String methodName)Creates postAdministration.ReflectiveAdministrationBuilderpreAdminister(java.lang.String methodName)Creates preAdministration.voidsetNextFunction(java.lang.String functionName)Specifies the nextManagedFunctionusing the return type of theMethodas the argument type.-
Methods inherited from class net.officefloor.frame.api.function.StaticManagedFunction
createManagedFunction
-
-
-
-
Constructor Detail
-
ReflectiveFunctionBuilder
public ReflectiveFunctionBuilder(java.lang.Class<C> clazz, C object, java.lang.String methodName, OfficeBuilder officeBuilder, ConstructTestSupport constructTestSupport)Initiate.- Type Parameters:
C-ManagedFunctionMethodcontainingClasstype.- Parameters:
clazz-Class.object- Object should the method not bestatic. May benullifstaticMethodof theClass.methodName- Name of theMethodto invoke.officeBuilder-OfficeBuilder.constructTestSupport-ConstructTestSupport.
-
-
Method Detail
-
getBuilder
public ManagedFunctionBuilder<Indexed,Indexed> getBuilder()
Obtains theManagedFunctionBuilder.- Returns:
ManagedFunctionBuilder.
-
buildManagedFunctionContext
public void buildManagedFunctionContext()
Builds theManagedFunctionContext.
-
buildParameter
public void buildParameter()
Builds the parameter.
-
buildAsynchronousFlow
public void buildAsynchronousFlow()
BuildsAsynchronousFlow.
-
buildObject
public void buildObject(java.lang.String scopeManagedObjectName)
Links theManagedObjectto theManagedFunction.- Parameters:
scopeManagedObjectName- Scope name of theManagedObject.
-
buildObject
public DependencyMappingBuilder buildObject(java.lang.String officeManagedObjectName, ManagedObjectScope managedObjectScope)
Builds theManagedObjectScopeboundManagedObject.- Parameters:
officeManagedObjectName-Officename of theManagedObject.managedObjectScope-ManagedObjectScopefor theManagedObject.- Returns:
DependencyMappingBuilder.
-
buildFlow
public void buildFlow(java.lang.String functionName, java.lang.Class<?> argumentType, boolean isSpawnThreadState)Builds the flow.- Parameters:
functionName-ManagedFunctionname.argumentType- Type of argument passed to theFlow.isSpawnThreadState-trueto spawn inThreadState.
-
setNextFunction
public void setNextFunction(java.lang.String functionName)
Specifies the nextManagedFunctionusing the return type of theMethodas the argument type.- Parameters:
functionName-ManagedFunctionname.
-
preAdminister
public ReflectiveAdministrationBuilder preAdminister(java.lang.String methodName)
Creates preAdministration.- Parameters:
methodName- Name ofMethodforAdministration.- Returns:
ReflectiveAdministrationBuilder.
-
postAdminister
public ReflectiveAdministrationBuilder postAdminister(java.lang.String methodName)
Creates postAdministration.- Parameters:
methodName- Name ofMethodforAdministration.- Returns:
ReflectiveAdministrationBuilder.
-
execute
public void execute(ManagedFunctionContext<Indexed,Indexed> context) throws java.lang.Throwable
Description copied from interface:ManagedFunctionExecutes the function.- Parameters:
context-ManagedFunctionContextfor theManagedFunction.- Throws:
java.lang.Throwable- Indicating failure of theManagedFunction.
-
-