java.lang.Object
net.officefloor.frame.impl.construct.function.AbstractFunctionBuilder<F>
net.officefloor.frame.impl.construct.managedfunction.ManagedFunctionBuilderImpl<O,F>
- All Implemented Interfaces:
FlowBuilder<F>,FunctionBuilder<F>,ManagedFunctionBuilder<O,,F> FunctionConfiguration<F>,ManagedFunctionConfiguration<O,F>
public class ManagedFunctionBuilderImpl<O extends Enum<O>,F extends Enum<F>>
extends AbstractFunctionBuilder<F>
implements ManagedFunctionBuilder<O,F>, ManagedFunctionConfiguration<O,F>
Implementation of the
ManagedFunctionBuilder.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionManagedFunctionBuilderImpl(String functionName, ManagedFunctionFactory<O, F> functionFactory) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(Object annotation) Adds the annotation for thisManagedFunction.voidaddGovernance(String governanceName) AddsGovernanceto thisManagedFunction.addManagedObject(String functionManagedObjectName, String officeManagedObjectName) Adds aManagedObjectbound to thisManagedFunction.Object[]Obtains the annotations for theManagedFunction.longObtains the timeout for anyAsynchronousFlowinstigated.Obtains the name of thisManagedFunction.Obtains the configuration of theGovernanceinstances for thisManagedFunction.Obtains theManagedFunctionFactoryfor theManagedFunction.Obtains the configuration of theManagedFunctionboundManagedObjectinstances.Obtains the reference to the nextManagedFunction.Obtains the configuration of the dependentObjectinstances for thisManagedFunction.AdministrationConfiguration<?,?, ?>[] Obtains the listing of theAdministrationto be done after theManagedFunctionis executed.AdministrationConfiguration<?,?, ?>[] Obtains the listing of theAdministrationto be done before theManagedFunctionis executed.voidlinkManagedObject(int index, String scopeManagedObjectName, Class<?> objectType) Links in aManagedObjectto thisManagedFunction.voidlinkManagedObject(O key, String scopeManagedObjectName, Class<?> objectType) Links in aManagedObjectto thisManagedFunction.voidlinkParameter(int index, Class<?> parameterType) Links in the parameter for thisManagedFunction.voidlinkParameter(O key, Class<?> parameterType) Links in the parameter for thisManagedFunction.<E,f extends Enum<f>, G extends Enum<G>>
AdministrationBuilder<f,G> postAdminister(String administrationName, Class<E> extension, AdministrationFactory<E, f, G> administrationFactory) AddsAdministrationto be undertaken after thisManagedFunction.<E,f extends Enum<f>, G extends Enum<G>>
AdministrationBuilder<f,G> preAdminister(String administrationName, Class<E> extension, AdministrationFactory<E, f, G> administrationFactory) AddsAdministrationto be undertaken before thisManagedFunction.voidsetAsynchronousFlowTimeout(long timeout) Specifies the timeout to forAsynchronousFlowinstances for thisManagedFunction.voidsetNextFunction(String functionName, Class<?> argumentType) Specifies the nextManagedFunctionto be executed.Methods inherited from class net.officefloor.frame.impl.construct.function.AbstractFunctionBuilder
addEscalation, getEscalations, getFlowConfiguration, getResponsibleTeamName, linkFlow, linkFlow, setResponsibleTeamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.frame.api.build.FunctionBuilder
addEscalation, linkFlow, linkFlow, setResponsibleTeamMethods inherited from interface net.officefloor.frame.internal.configuration.FunctionConfiguration
getEscalations, getFlowConfiguration, getResponsibleTeamName
-
Constructor Details
-
ManagedFunctionBuilderImpl
Initiate.- Parameters:
functionName- Name of thisManagedFunction.functionFactory-ManagedFunctionFactory.
-
-
Method Details
-
addAnnotation
Description copied from interface:ManagedFunctionBuilderAdds the annotation for this
ManagedFunction.This is exposed as is on the
FunctionManagerinterface for thisManagedFunctionto allow reflective:- identification of this
ManagedFunction(e.g. can check on type of this object) - means to trigger functionality on this
ManagedFunction(e.g. can expose functionality to be invoked)
It is also exposed to
Administrationto enable reflective administration.- Specified by:
addAnnotationin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
annotation- Annotation.
- identification of this
-
setNextFunction
Description copied from interface:FlowBuilderSpecifies the nextManagedFunctionto be executed.- Specified by:
setNextFunctionin interfaceFlowBuilder<O extends Enum<O>>- Parameters:
functionName- Name of the nextManagedFunction.argumentType- Type of argument passed to the nextManagedFunction. May benullto indicate no argument.
-
linkParameter
Description copied from interface:ManagedFunctionBuilderLinks in the parameter for thisManagedFunction.- Specified by:
linkParameterin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
key- Key identifying the parameter.parameterType- Type of the parameter.
-
linkParameter
Description copied from interface:ManagedFunctionBuilderLinks in the parameter for thisManagedFunction.- Specified by:
linkParameterin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
index- Index identifying the parameter.parameterType- Type of the parameter.
-
linkManagedObject
Description copied from interface:ManagedFunctionBuilderLinks in aManagedObjectto thisManagedFunction.- Specified by:
linkManagedObjectin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
key- Key identifying theManagedObject.scopeManagedObjectName- Name of theManagedObjectwithin theManagedObjectScope.objectType- Type required by theManagedFunction.
-
linkManagedObject
Description copied from interface:ManagedFunctionBuilderLinks in aManagedObjectto thisManagedFunction.- Specified by:
linkManagedObjectin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
index- Index of theManagedObject.scopeManagedObjectName- Name of theManagedObjectwithin theManagedObjectScope.objectType- Type required by theManagedFunction.
-
addManagedObject
public DependencyMappingBuilder addManagedObject(String functionManagedObjectName, String officeManagedObjectName) Description copied from interface:ManagedFunctionBuilderAdds a
ManagedObjectbound to thisManagedFunction.Dependency scope:
- Other
ManagedObjectinstances added via this method. ThreadStateboundManagedObjectinstances.ProcessStateboundManagedObjectinstances.
- Specified by:
addManagedObjectin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
functionManagedObjectName- Name of theManagedObjectto be referenced locally by thisManagedFunction.officeManagedObjectName- Name of theManagedObjectreferenced locally within theOffice.- Returns:
DependencyMappingBuilder.
- Other
-
preAdminister
public <E,f extends Enum<f>, AdministrationBuilder<f,G extends Enum<G>> G> preAdminister(String administrationName, Class<E> extension, AdministrationFactory<E, f, G> administrationFactory) Description copied from interface:ManagedFunctionBuilderAddsAdministrationto be undertaken before thisManagedFunction.- Specified by:
preAdministerin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Type Parameters:
E- Extension type.f-Flowkey type.G-Governancekey type.- Parameters:
administrationName- Name of theAdministration.extension- Extension type forAdministration.administrationFactory-AdministrationFactory.- Returns:
AdministrationBuilderto build theAdministration.
-
postAdminister
public <E,f extends Enum<f>, AdministrationBuilder<f,G extends Enum<G>> G> postAdminister(String administrationName, Class<E> extension, AdministrationFactory<E, f, G> administrationFactory) Description copied from interface:ManagedFunctionBuilderAddsAdministrationto be undertaken after thisManagedFunction.- Specified by:
postAdministerin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Type Parameters:
E- Extension type.f-Flowkey type.G-Governancekey type.- Parameters:
administrationName- Name of theAdministration.extension- Extension type forAdministration.administrationFactory-AdministrationFactory.- Returns:
AdministrationBuilderto build theAdministration.
-
addGovernance
Description copied from interface:ManagedFunctionBuilderAdds
Governanceto thisManagedFunction.In other words, to execute this
ManagedFunctiontheGovernancewill be automatically activated before theManagedFunctionis executed (or stay active from previousManagedFunction).The
Governancewill be:- enforced when either a
ManagedFunctiondoes not require theGovernanceor theThreadStatecompletes. - disregarded when an escalation occurs to a
ManagedFunctionnot requiring theGovernance. Note that this does allow theGovernanceto stay active should theEscalationManagedFunctionrequire theGovernance. - Manually managed by an
Administration
- Specified by:
addGovernancein interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
governanceName- Name of theGovernance.
- enforced when either a
-
setAsynchronousFlowTimeout
public void setAsynchronousFlowTimeout(long timeout) Description copied from interface:ManagedFunctionBuilderSpecifies the timeout to forAsynchronousFlowinstances for thisManagedFunction.- Specified by:
setAsynchronousFlowTimeoutin interfaceManagedFunctionBuilder<O extends Enum<O>,F extends Enum<F>> - Parameters:
timeout- Timeout.
-
getFunctionName
Description copied from interface:ManagedFunctionConfigurationObtains the name of thisManagedFunction.- Specified by:
getFunctionNamein interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Name of this
ManagedFunction.
-
getManagedFunctionFactory
Description copied from interface:ManagedFunctionConfigurationObtains theManagedFunctionFactoryfor theManagedFunction.- Specified by:
getManagedFunctionFactoryin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
ManagedFunctionFactory.
-
getAnnotations
Description copied from interface:ManagedFunctionConfigurationObtains the annotations for theManagedFunction.- Specified by:
getAnnotationsin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Annotations for the
ManagedFunction.
-
getObjectConfiguration
Description copied from interface:ManagedFunctionConfigurationObtains the configuration of the dependentObjectinstances for thisManagedFunction.- Specified by:
getObjectConfigurationin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Configuration of the dependent
Objectinstances for thisManagedFunction.
-
getGovernanceConfiguration
Description copied from interface:ManagedFunctionConfigurationObtains the configuration of theGovernanceinstances for thisManagedFunction.- Specified by:
getGovernanceConfigurationin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Configuration of the
Governancefor thisManagedFunction.
-
getNextFunction
Description copied from interface:ManagedFunctionConfigurationObtains the reference to the nextManagedFunction.- Specified by:
getNextFunctionin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Reference to the next
ManagedFunction.
-
getPreAdministration
Description copied from interface:ManagedFunctionConfigurationObtains the listing of theAdministrationto be done before theManagedFunctionis executed.- Specified by:
getPreAdministrationin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Listing of the
Administrationto be done before theManagedFunctionis executed.
-
getPostAdministration
Description copied from interface:ManagedFunctionConfigurationObtains the listing of theAdministrationto be done after theManagedFunctionis executed.- Specified by:
getPostAdministrationin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Listing of the
Administrationto be done after theManagedFunctionis executed.
-
getManagedObjectConfiguration
Description copied from interface:ManagedFunctionConfigurationObtains the configuration of theManagedFunctionboundManagedObjectinstances.- Specified by:
getManagedObjectConfigurationin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Listing of the
ManagedObjectconfiguration for thisManagedFunction.
-
getAsynchronousFlowTimeout
public long getAsynchronousFlowTimeout()Description copied from interface:ManagedFunctionConfigurationObtains the timeout for anyAsynchronousFlowinstigated.- Specified by:
getAsynchronousFlowTimeoutin interfaceManagedFunctionConfiguration<O extends Enum<O>,F extends Enum<F>> - Returns:
- Timeout for any
AsynchronousFlowinstigated.
-