Class ManagedFunctionContainerImpl<M extends ManagedFunctionLogicMetaData>
- All Implemented Interfaces:
BlockState,FunctionState,LinkedListSetEntry<FunctionState,,Flow> ManagedFunctionContainer
FunctionState to execute a ManagedFunctionLogic.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionManagedFunctionContainerImpl(FunctionState setupFunction, ManagedFunctionLogic managedFunctionLogic, ManagedFunctionBoundManagedObjects boundManagedObjects, ManagedObjectIndex[] requiredManagedObjects, boolean[] requiredGovernance, boolean isEnforceGovernance, M functionLogicMetaData, BlockState parallelOwner, Flow flow, boolean isUnloadManagedObjects) Initiate. -
Method Summary
Modifier and TypeMethodDescriptioncancel()Creates aManagedFunctionInterestin thisManagedFunctionContainer.execute(FunctionStateContext context) Executes theFunctionState.getFlow()Obtains theFlowcontaining thisManagedObjectContainer.Obtains the owner of theLinkedListSetthat thisLinkedListSetEntrymay be added.getManagedObjectContainer(int index) Obtains theManagedObjectContainerbound to thisManagedFunctionContainer.Obtains the parallelBlockState.Obtains the parallel ownerBlockState.Obtains theTeamManagementresponsible for thisFunctionState.Obtains the sequentialBlockState.Obtains theThreadStatefor thisFunctionState.handleEscalation(Throwable escalation, EscalationCompletion completion) HandlesEscalationfrom theManagedFunction.booleanIndicates if theFunctionStaterequiresThreadStatesafety.voidsetParallelBlock(BlockState parallelBlock) Specifies the parallelBlockState.voidsetParallelOwner(BlockState parallelOwner) Specifies the parallel owningBlockState.voidsetSequentialBlock(BlockState sequentialBlock) Specifies the sequentialBlockState.toString()Methods inherited from class net.officefloor.frame.impl.execute.linkedlistset.AbstractLinkedListSetEntry
getNext, getPrev, setNext, setPrevMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.officefloor.frame.internal.structure.BlockState
getNextBlockToExecute, getParallelBlockToExecute, loadParallelBlock, loadSequentialBlockMethods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
Constructor Details
-
ManagedFunctionContainerImpl
public ManagedFunctionContainerImpl(FunctionState setupFunction, ManagedFunctionLogic managedFunctionLogic, ManagedFunctionBoundManagedObjects boundManagedObjects, ManagedObjectIndex[] requiredManagedObjects, boolean[] requiredGovernance, boolean isEnforceGovernance, M functionLogicMetaData, BlockState parallelOwner, Flow flow, boolean isUnloadManagedObjects) Initiate.- Parameters:
setupFunction- OptionalFunctionStateto be executed to setup thisManagedObjectContainer. May benull.managedFunctionLogic-ManagedFunctionLogicto be executed by thisManagedFunctionContainer.boundManagedObjects-ManagedFunctionBoundManagedObjectscontaining theManagedObjectContainerinstances for theManagedObjectinstances bound to theManagedFunction.requiredManagedObjects-ManagedObjectIndexinstances to theManagedObjectinstances that must be loaded before theManagedFunctionmay be executed.requiredGovernance- Identifies the required activation state of theGovernancefor thisManagedFunction.isEnforceGovernance-trueto enforceGovernanceon deactivation.falseto disregardGovernanceon deactivation.functionLogicMetaData-ManagedFunctionLogicMetaDatafor this node.parallelOwner- Parallel owner of thisManagedFunctionContainer. May benullif no owner.flow-Flowcontaining thisManagedFunctionContainer.isUnloadManagedObjects- Indicates whether thisManagedObjectContaineris responsible for unloading theManagedObjectinstances.
-
-
Method Details
-
toString
-
getLinkedListSetOwner
Description copied from interface:LinkedListSetEntryObtains the owner of the
LinkedListSetthat thisLinkedListSetEntrymay be added.LinkedListSetEntryinstances may only be added to theLinkedListSetthey were intended for and can not be shared betweenLinkedListSetinstances. This constraint:- ensures the integrity of the
FunctionState,Flow,ThreadState,ProcessStatestructure, and - improves uniqueness performance as
LinkedListSetEntry.getNext()andLinkedListSetEntry.getPrev()both returningnullindicates not added
- Specified by:
getLinkedListSetOwnerin interfaceFunctionState- Specified by:
getLinkedListSetOwnerin interfaceLinkedListSetEntry<FunctionState,Flow> - Returns:
- Owner of the
LinkedListSetthat may contain thisLinkedListSetEntry.
- ensures the integrity of the
-
setParallelOwner
Description copied from interface:BlockStateSpecifies the parallel owningBlockState.- Specified by:
setParallelOwnerin interfaceBlockState- Parameters:
parallelOwner- Parallel owningBlockState.
-
getParallelOwner
Description copied from interface:BlockStateObtains the parallel ownerBlockState.- Specified by:
getParallelOwnerin interfaceBlockState- Returns:
- Parallel owner
BlockState.
-
setParallelBlock
Description copied from interface:BlockStateSpecifies the parallelBlockState.- Specified by:
setParallelBlockin interfaceBlockState- Parameters:
parallelBlock- ParallelBlockState.
-
getParallelBlock
Description copied from interface:BlockStateObtains the parallelBlockState.- Specified by:
getParallelBlockin interfaceBlockState- Returns:
- Parallel
BlockState.
-
setSequentialBlock
Description copied from interface:BlockStateSpecifies the sequentialBlockState.- Specified by:
setSequentialBlockin interfaceBlockState- Parameters:
sequentialBlock- SequentialBlockState.
-
getSequentialBlock
Description copied from interface:BlockStateObtains the sequentialBlockState.- Specified by:
getSequentialBlockin interfaceBlockState- Returns:
- Sequential
BlockState.
-
getFlow
Description copied from interface:ManagedFunctionContainerObtains theFlowcontaining thisManagedObjectContainer.- Specified by:
getFlowin interfaceManagedFunctionContainer- Returns:
Flowcontaining thisManagedObjectContainer.
-
getManagedObjectContainer
Description copied from interface:ManagedFunctionContainerObtains theManagedObjectContainerbound to thisManagedFunctionContainer.- Specified by:
getManagedObjectContainerin interfaceManagedFunctionContainer- Parameters:
index- Index of theManagedObjectContainer.- Returns:
ManagedObjectContainerbound to thisManagedFunctionContainer.
-
createInterest
Description copied from interface:ManagedFunctionContainerCreates a
ManagedFunctionInterestin thisManagedFunctionContainer.The
ManagedFunctionContainerwill not unload itsManagedFunctionboundManagedObjectinstances until all registeredManagedFunctionInterestinstances have been unregistered.- Specified by:
createInterestin interfaceManagedFunctionContainer- Returns:
- New
ManagedFunctionInterestin thisManagedFunctionContainer.
-
getResponsibleTeam
Description copied from interface:FunctionStateObtains the
TeamManagementresponsible for thisFunctionState.By default,
FunctionStatemay be executed by anyTeamManagement.- Specified by:
getResponsibleTeamin interfaceFunctionState- Returns:
TeamManagementresponsible for thisFunctionState. May benullto indicate anyTeammay execute theFunctionState.
-
getThreadState
Description copied from interface:FunctionStateObtains the
ThreadStatefor thisFunctionState.This provides access to the
ThreadStatethat thisFunctionStateresides within.- Specified by:
getThreadStatein interfaceFunctionState- Returns:
ThreadStatefor thisFunctionState.
-
isRequireThreadStateSafety
public boolean isRequireThreadStateSafety()Description copied from interface:FunctionStateIndicates if theFunctionStaterequiresThreadStatesafety.- Specified by:
isRequireThreadStateSafetyin interfaceFunctionState- Returns:
trueshouldFunctionStaterequireThreadStatesafety.
-
execute
Description copied from interface:FunctionStateExecutes theFunctionState.- Specified by:
executein interfaceFunctionState- Parameters:
context-FunctionStateContextfor executing theFunctionState.- Returns:
- Next
FunctionStateto be executed. May benullto indicate no furtherFunctionStateinstances to execute. - Throws:
Throwable- Possible failure ofFunctionStatelogic.
-
handleEscalation
Description copied from interface:FunctionStateHandlesEscalationfrom theManagedFunction.- Specified by:
handleEscalationin interfaceFunctionState- Parameters:
escalation-Escalation.completion- OptionalEscalationCompletionto be notified onceEscalationhas been handled.- Returns:
- Optional
FunctionStateto handle theEscalation.
-
cancel
Description copied from interface:FunctionState- Specified by:
cancelin interfaceFunctionState- Returns:
- Optional clean up
FunctionState. May benull.
-