Class ManagedFunctionContainerImpl<M extends ManagedFunctionLogicMetaData>
- java.lang.Object
-
- net.officefloor.frame.impl.execute.linkedlistset.AbstractLinkedListSetEntry<FunctionState,Flow>
-
- net.officefloor.frame.impl.execute.function.ManagedFunctionContainerImpl<M>
-
- All Implemented Interfaces:
BlockState,FunctionState,LinkedListSetEntry<FunctionState,Flow>,ManagedFunctionContainer
public class ManagedFunctionContainerImpl<M extends ManagedFunctionLogicMetaData> extends AbstractLinkedListSetEntry<FunctionState,Flow> implements ManagedFunctionContainer
FunctionStateto execute aManagedFunctionLogic.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ManagedFunctionContainerImpl(FunctionState setupFunction, ManagedFunctionLogic managedFunctionLogic, ManagedFunctionBoundManagedObjects boundManagedObjects, ManagedObjectIndex[] requiredManagedObjects, boolean[] requiredGovernance, boolean isEnforceGovernance, M functionLogicMetaData, BlockState parallelOwner, Flow flow, boolean isUnloadManagedObjects)Initiate.
-
Method Summary
-
Methods inherited from class net.officefloor.frame.impl.execute.linkedlistset.AbstractLinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.officefloor.frame.internal.structure.BlockState
getNextBlockToExecute, getParallelBlockToExecute, loadParallelBlock, loadSequentialBlock
-
Methods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
-
-
-
Constructor Detail
-
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 Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLinkedListSetOwner
public Flow 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
public void setParallelOwner(BlockState parallelOwner)
Description copied from interface:BlockStateSpecifies the parallel owningBlockState.- Specified by:
setParallelOwnerin interfaceBlockState- Parameters:
parallelOwner- Parallel owningBlockState.
-
getParallelOwner
public BlockState getParallelOwner()
Description copied from interface:BlockStateObtains the parallel ownerBlockState.- Specified by:
getParallelOwnerin interfaceBlockState- Returns:
- Parallel owner
BlockState.
-
setParallelBlock
public void setParallelBlock(BlockState parallelBlock)
Description copied from interface:BlockStateSpecifies the parallelBlockState.- Specified by:
setParallelBlockin interfaceBlockState- Parameters:
parallelBlock- ParallelBlockState.
-
getParallelBlock
public BlockState getParallelBlock()
Description copied from interface:BlockStateObtains the parallelBlockState.- Specified by:
getParallelBlockin interfaceBlockState- Returns:
- Parallel
BlockState.
-
setSequentialBlock
public void setSequentialBlock(BlockState sequentialBlock)
Description copied from interface:BlockStateSpecifies the sequentialBlockState.- Specified by:
setSequentialBlockin interfaceBlockState- Parameters:
sequentialBlock- SequentialBlockState.
-
getSequentialBlock
public BlockState getSequentialBlock()
Description copied from interface:BlockStateObtains the sequentialBlockState.- Specified by:
getSequentialBlockin interfaceBlockState- Returns:
- Sequential
BlockState.
-
getFlow
public Flow getFlow()
Description copied from interface:ManagedFunctionContainerObtains theFlowcontaining thisManagedObjectContainer.- Specified by:
getFlowin interfaceManagedFunctionContainer- Returns:
Flowcontaining thisManagedObjectContainer.
-
getManagedObjectContainer
public ManagedObjectContainer getManagedObjectContainer(int index)
Description copied from interface:ManagedFunctionContainerObtains theManagedObjectContainerbound to thisManagedFunctionContainer.- Specified by:
getManagedObjectContainerin interfaceManagedFunctionContainer- Parameters:
index- Index of theManagedObjectContainer.- Returns:
ManagedObjectContainerbound to thisManagedFunctionContainer.
-
createInterest
public ManagedFunctionInterest 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
public TeamManagement 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
public ThreadState 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
public FunctionState execute(FunctionStateContext context) throws java.lang.Throwable
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:
java.lang.Throwable- Possible failure ofFunctionStatelogic.
-
handleEscalation
public FunctionState handleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)
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
public FunctionState cancel()
Description copied from interface:FunctionState- Specified by:
cancelin interfaceFunctionState- Returns:
- Optional clean up
FunctionState. May benull.
-
-