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 void
buildAsynchronousFlow()
BuildsAsynchronousFlow
.void
buildFlow(java.lang.String functionName, java.lang.Class<?> argumentType, boolean isSpawnThreadState)
Builds the flow.void
buildManagedFunctionContext()
Builds theManagedFunctionContext
.void
buildObject(java.lang.String scopeManagedObjectName)
Links theManagedObject
to theManagedFunction
.DependencyMappingBuilder
buildObject(java.lang.String officeManagedObjectName, ManagedObjectScope managedObjectScope)
Builds theManagedObjectScope
boundManagedObject
.void
buildParameter()
Builds the parameter.void
execute(ManagedFunctionContext<Indexed,Indexed> context)
Executes the function.ManagedFunctionBuilder<Indexed,Indexed>
getBuilder()
Obtains theManagedFunctionBuilder
.ReflectiveAdministrationBuilder
postAdminister(java.lang.String methodName)
Creates postAdministration
.ReflectiveAdministrationBuilder
preAdminister(java.lang.String methodName)
Creates preAdministration
.void
setNextFunction(java.lang.String functionName)
Specifies the nextManagedFunction
using the return type of theMethod
as 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
-ManagedFunction
Method
containingClass
type.- Parameters:
clazz
-Class
.object
- Object should the method not bestatic
. May benull
ifstatic
Method
of theClass
.methodName
- Name of theMethod
to 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 theManagedObject
to theManagedFunction
.- Parameters:
scopeManagedObjectName
- Scope name of theManagedObject
.
-
buildObject
public DependencyMappingBuilder buildObject(java.lang.String officeManagedObjectName, ManagedObjectScope managedObjectScope)
Builds theManagedObjectScope
boundManagedObject
.- Parameters:
officeManagedObjectName
-Office
name of theManagedObject
.managedObjectScope
-ManagedObjectScope
for theManagedObject
.- Returns:
DependencyMappingBuilder
.
-
buildFlow
public void buildFlow(java.lang.String functionName, java.lang.Class<?> argumentType, boolean isSpawnThreadState)
Builds the flow.- Parameters:
functionName
-ManagedFunction
name.argumentType
- Type of argument passed to theFlow
.isSpawnThreadState
-true
to spawn inThreadState
.
-
setNextFunction
public void setNextFunction(java.lang.String functionName)
Specifies the nextManagedFunction
using the return type of theMethod
as the argument type.- Parameters:
functionName
-ManagedFunction
name.
-
preAdminister
public ReflectiveAdministrationBuilder preAdminister(java.lang.String methodName)
Creates preAdministration
.- Parameters:
methodName
- Name ofMethod
forAdministration
.- Returns:
ReflectiveAdministrationBuilder
.
-
postAdminister
public ReflectiveAdministrationBuilder postAdminister(java.lang.String methodName)
Creates postAdministration
.- Parameters:
methodName
- Name ofMethod
forAdministration
.- Returns:
ReflectiveAdministrationBuilder
.
-
execute
public void execute(ManagedFunctionContext<Indexed,Indexed> context) throws java.lang.Throwable
Description copied from interface:ManagedFunction
Executes the function.- Parameters:
context
-ManagedFunctionContext
for theManagedFunction
.- Throws:
java.lang.Throwable
- Indicating failure of theManagedFunction
.
-
-