Class ManagedFunctionBuilderImpl<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- 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 java.lang.Enum<O>,F extends java.lang.Enum<F>> extends AbstractFunctionBuilder<F> implements ManagedFunctionBuilder<O,F>, ManagedFunctionConfiguration<O,F>
Implementation of theManagedFunctionBuilder.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ManagedFunctionBuilderImpl(java.lang.String functionName, ManagedFunctionFactory<O,F> functionFactory)Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(java.lang.Object annotation)Adds the annotation for thisManagedFunction.voidaddGovernance(java.lang.String governanceName)AddsGovernanceto thisManagedFunction.DependencyMappingBuilderaddManagedObject(java.lang.String functionManagedObjectName, java.lang.String officeManagedObjectName)Adds aManagedObjectbound to thisManagedFunction.java.lang.Object[]getAnnotations()Obtains the annotations for theManagedFunction.longgetAsynchronousFlowTimeout()Obtains the timeout for anyAsynchronousFlowinstigated.java.lang.StringgetFunctionName()Obtains the name of thisManagedFunction.ManagedFunctionGovernanceConfiguration[]getGovernanceConfiguration()Obtains the configuration of theGovernanceinstances for thisManagedFunction.ManagedFunctionFactory<O,F>getManagedFunctionFactory()Obtains theManagedFunctionFactoryfor theManagedFunction.ManagedObjectConfiguration<?>[]getManagedObjectConfiguration()Obtains the configuration of theManagedFunctionboundManagedObjectinstances.ManagedFunctionReferencegetNextFunction()Obtains the reference to the nextManagedFunction.ManagedFunctionObjectConfiguration<O>[]getObjectConfiguration()Obtains the configuration of the dependentObjectinstances for thisManagedFunction.AdministrationConfiguration<?,?,?>[]getPostAdministration()Obtains the listing of theAdministrationto be done after theManagedFunctionis executed.AdministrationConfiguration<?,?,?>[]getPreAdministration()Obtains the listing of theAdministrationto be done before theManagedFunctionis executed.voidlinkManagedObject(int index, java.lang.String scopeManagedObjectName, java.lang.Class<?> objectType)Links in aManagedObjectto thisManagedFunction.voidlinkManagedObject(O key, java.lang.String scopeManagedObjectName, java.lang.Class<?> objectType)Links in aManagedObjectto thisManagedFunction.voidlinkParameter(int index, java.lang.Class<?> parameterType)Links in the parameter for thisManagedFunction.voidlinkParameter(O key, java.lang.Class<?> parameterType)Links in the parameter for thisManagedFunction.<E,f extends java.lang.Enum<f>,G extends java.lang.Enum<G>>
AdministrationBuilder<f,G>postAdminister(java.lang.String administrationName, java.lang.Class<E> extension, AdministrationFactory<E,f,G> administrationFactory)AddsAdministrationto be undertaken after thisManagedFunction.<E,f extends java.lang.Enum<f>,G extends java.lang.Enum<G>>
AdministrationBuilder<f,G>preAdminister(java.lang.String administrationName, java.lang.Class<E> extension, AdministrationFactory<E,f,G> administrationFactory)AddsAdministrationto be undertaken before thisManagedFunction.voidsetAsynchronousFlowTimeout(long timeout)Specifies the timeout to forAsynchronousFlowinstances for thisManagedFunction.voidsetNextFunction(java.lang.String functionName, java.lang.Class<?> argumentType)Specifies the nextManagedFunctionto be executed.-
Methods inherited from class net.officefloor.frame.impl.construct.function.AbstractFunctionBuilder
addEscalation, getEscalations, getFlowConfiguration, getResponsibleTeamName, linkFlow, linkFlow, setResponsibleTeam
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.frame.api.build.FunctionBuilder
addEscalation, linkFlow, linkFlow, setResponsibleTeam
-
Methods inherited from interface net.officefloor.frame.internal.configuration.FunctionConfiguration
getEscalations, getFlowConfiguration, getResponsibleTeamName
-
-
-
-
Constructor Detail
-
ManagedFunctionBuilderImpl
public ManagedFunctionBuilderImpl(java.lang.String functionName, ManagedFunctionFactory<O,F> functionFactory)Initiate.- Parameters:
functionName- Name of thisManagedFunction.functionFactory-ManagedFunctionFactory.
-
-
Method Detail
-
addAnnotation
public void addAnnotation(java.lang.Object annotation)
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)
- Specified by:
addAnnotationin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
annotation- Annotation.
- identification of this
-
setNextFunction
public void setNextFunction(java.lang.String functionName, java.lang.Class<?> argumentType)Description copied from interface:FlowBuilderSpecifies the nextManagedFunctionto be executed.- Specified by:
setNextFunctionin interfaceFlowBuilder<O extends java.lang.Enum<O>>- Parameters:
functionName- Name of the nextManagedFunction.argumentType- Type of argument passed to the nextManagedFunction. May benullto indicate no argument.
-
linkParameter
public void linkParameter(O key, java.lang.Class<?> parameterType)
Description copied from interface:ManagedFunctionBuilderLinks in the parameter for thisManagedFunction.- Specified by:
linkParameterin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
key- Key identifying the parameter.parameterType- Type of the parameter.
-
linkParameter
public void linkParameter(int index, java.lang.Class<?> parameterType)Description copied from interface:ManagedFunctionBuilderLinks in the parameter for thisManagedFunction.- Specified by:
linkParameterin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
index- Index identifying the parameter.parameterType- Type of the parameter.
-
linkManagedObject
public void linkManagedObject(O key, java.lang.String scopeManagedObjectName, java.lang.Class<?> objectType)
Description copied from interface:ManagedFunctionBuilderLinks in aManagedObjectto thisManagedFunction.- Specified by:
linkManagedObjectin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
key- Key identifying theManagedObject.scopeManagedObjectName- Name of theManagedObjectwithin theManagedObjectScope.objectType- Type required by theManagedFunction.
-
linkManagedObject
public void linkManagedObject(int index, java.lang.String scopeManagedObjectName, java.lang.Class<?> objectType)Description copied from interface:ManagedFunctionBuilderLinks in aManagedObjectto thisManagedFunction.- Specified by:
linkManagedObjectin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
index- Index of theManagedObject.scopeManagedObjectName- Name of theManagedObjectwithin theManagedObjectScope.objectType- Type required by theManagedFunction.
-
addManagedObject
public DependencyMappingBuilder addManagedObject(java.lang.String functionManagedObjectName, java.lang.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 java.lang.Enum<O>,F extends java.lang.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 java.lang.Enum<f>,G extends java.lang.Enum<G>> AdministrationBuilder<f,G> preAdminister(java.lang.String administrationName, java.lang.Class<E> extension, AdministrationFactory<E,f,G> administrationFactory)
Description copied from interface:ManagedFunctionBuilderAddsAdministrationto be undertaken before thisManagedFunction.- Specified by:
preAdministerin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.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 java.lang.Enum<f>,G extends java.lang.Enum<G>> AdministrationBuilder<f,G> postAdminister(java.lang.String administrationName, java.lang.Class<E> extension, AdministrationFactory<E,f,G> administrationFactory)
Description copied from interface:ManagedFunctionBuilderAddsAdministrationto be undertaken after thisManagedFunction.- Specified by:
postAdministerin interfaceManagedFunctionBuilder<O extends java.lang.Enum<O>,F extends java.lang.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
public void addGovernance(java.lang.String governanceName)
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 java.lang.Enum<O>,F extends java.lang.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 java.lang.Enum<O>,F extends java.lang.Enum<F>>- Parameters:
timeout- Timeout.
-
getFunctionName
public java.lang.String getFunctionName()
Description copied from interface:ManagedFunctionConfigurationObtains the name of thisManagedFunction.- Specified by:
getFunctionNamein interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Name of this
ManagedFunction.
-
getManagedFunctionFactory
public ManagedFunctionFactory<O,F> getManagedFunctionFactory()
Description copied from interface:ManagedFunctionConfigurationObtains theManagedFunctionFactoryfor theManagedFunction.- Specified by:
getManagedFunctionFactoryin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
ManagedFunctionFactory.
-
getAnnotations
public java.lang.Object[] getAnnotations()
Description copied from interface:ManagedFunctionConfigurationObtains the annotations for theManagedFunction.- Specified by:
getAnnotationsin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Annotations for the
ManagedFunction.
-
getObjectConfiguration
public ManagedFunctionObjectConfiguration<O>[] getObjectConfiguration()
Description copied from interface:ManagedFunctionConfigurationObtains the configuration of the dependentObjectinstances for thisManagedFunction.- Specified by:
getObjectConfigurationin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Configuration of the dependent
Objectinstances for thisManagedFunction.
-
getGovernanceConfiguration
public ManagedFunctionGovernanceConfiguration[] getGovernanceConfiguration()
Description copied from interface:ManagedFunctionConfigurationObtains the configuration of theGovernanceinstances for thisManagedFunction.- Specified by:
getGovernanceConfigurationin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Configuration of the
Governancefor thisManagedFunction.
-
getNextFunction
public ManagedFunctionReference getNextFunction()
Description copied from interface:ManagedFunctionConfigurationObtains the reference to the nextManagedFunction.- Specified by:
getNextFunctionin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Reference to the next
ManagedFunction.
-
getPreAdministration
public AdministrationConfiguration<?,?,?>[] getPreAdministration()
Description copied from interface:ManagedFunctionConfigurationObtains the listing of theAdministrationto be done before theManagedFunctionis executed.- Specified by:
getPreAdministrationin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Listing of the
Administrationto be done before theManagedFunctionis executed.
-
getPostAdministration
public AdministrationConfiguration<?,?,?>[] getPostAdministration()
Description copied from interface:ManagedFunctionConfigurationObtains the listing of theAdministrationto be done after theManagedFunctionis executed.- Specified by:
getPostAdministrationin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Listing of the
Administrationto be done after theManagedFunctionis executed.
-
getManagedObjectConfiguration
public ManagedObjectConfiguration<?>[] getManagedObjectConfiguration()
Description copied from interface:ManagedFunctionConfigurationObtains the configuration of theManagedFunctionboundManagedObjectinstances.- Specified by:
getManagedObjectConfigurationin interfaceManagedFunctionConfiguration<O extends java.lang.Enum<O>,F extends java.lang.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 java.lang.Enum<O>,F extends java.lang.Enum<F>>- Returns:
- Timeout for any
AsynchronousFlowinstigated.
-
-