Class FlowImpl
- java.lang.Object
-
- net.officefloor.frame.impl.execute.linkedlistset.AbstractLinkedListSetEntry<Flow,ThreadState>
-
- net.officefloor.frame.impl.execute.flow.FlowImpl
-
- All Implemented Interfaces:
Flow,LinkedListSetEntry<Flow,ThreadState>
public class FlowImpl extends AbstractLinkedListSetEntry<Flow,ThreadState> implements Flow
Implementation of theFlow.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description FlowImpl(FlowCompletion flowCompletion, EscalationCompletion escalationCompletion, ThreadState threadState)Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionStatecancel()Cancels thisFlow.<E,F extends java.lang.Enum<F>,G extends java.lang.Enum<G>>
ManagedFunctionContainercreateAdministrationFunction(ManagedObjectAdministrationMetaData<E,F,G> adminMetaData, ManagedFunctionContainer parallelFunctionOwner)Creates a newManagedFunctionContainercontained in thisFlowfor theManagedObjectAdministrationMetaData.FunctionStatecreateFunction(FunctionLogic logic)<F extends java.lang.Enum<F>>
ManagedFunctionContainercreateGovernanceFunction(GovernanceActivity<F> governanceActivity, GovernanceMetaData<?,F> governanceMetaData)<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
ManagedFunctionContainercreateManagedFunction(java.lang.Object parameter, ManagedFunctionMetaData<O,F> managedFunctionMetaData, boolean isEnforceGovernance, BlockState parallelFunctionOwner)ThreadStategetLinkedListSetOwner()Obtains the owner of theLinkedListSetthat thisLinkedListSetEntrymay be added.ThreadStategetThreadState()Obtains theThreadStatecontaining thisFlow.FunctionStatemanagedFunctionComplete(FunctionState function, java.lang.Throwable functionEscalation, EscalationCompletion escalationCompletion)Flags that the inputFunctionStatehas completed.-
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, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
-
-
-
Constructor Detail
-
FlowImpl
public FlowImpl(FlowCompletion flowCompletion, EscalationCompletion escalationCompletion, ThreadState threadState)
Initiate.- Parameters:
flowCompletion-FlowCompletionof thisFlow.escalationCompletion-EscalationCompletionfor thisFlow.threadState-ThreadStatecontaining thisFlow.
-
-
Method Detail
-
getLinkedListSetOwner
public ThreadState 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 interfaceLinkedListSetEntry<Flow,ThreadState>- Returns:
- Owner of the
LinkedListSetthat may contain thisLinkedListSetEntry.
- ensures the integrity of the
-
createFunction
public FunctionState createFunction(FunctionLogic logic)
Description copied from interface:Flow- Specified by:
createFunctionin interfaceFlow- Parameters:
logic-FunctionLogic.- Returns:
FunctionStatefor theFunctionLogic.
-
createManagedFunction
public <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> ManagedFunctionContainer createManagedFunction(java.lang.Object parameter, ManagedFunctionMetaData<O,F> managedFunctionMetaData, boolean isEnforceGovernance, BlockState parallelFunctionOwner)
Description copied from interface:Flow- Specified by:
createManagedFunctionin interfaceFlow- Type Parameters:
O- Dependency key type.F-Flowkey type.- Parameters:
parameter- Parameter for theManagedFunction.managedFunctionMetaData-ManagedFunctionMetaDatafor the newManagedFunction.isEnforceGovernance-trueto enforceGovernanceon deactivation.parallelFunctionOwner-BlockStatethat is the parallel owner of the newManagedFunction.- Returns:
- New
ManagedFunctionContainer.
-
createGovernanceFunction
public <F extends java.lang.Enum<F>> ManagedFunctionContainer createGovernanceFunction(GovernanceActivity<F> governanceActivity, GovernanceMetaData<?,F> governanceMetaData)
Description copied from interface:Flow- Specified by:
createGovernanceFunctionin interfaceFlow- Type Parameters:
F-Flowkey type.- Parameters:
governanceActivity-GovernanceActivity.governanceMetaData-GovernanceMetaData.- Returns:
- New
ManagedFunctionContainer.
-
createAdministrationFunction
public <E,F extends java.lang.Enum<F>,G extends java.lang.Enum<G>> ManagedFunctionContainer createAdministrationFunction(ManagedObjectAdministrationMetaData<E,F,G> adminMetaData, ManagedFunctionContainer parallelFunctionOwner)
Description copied from interface:FlowCreates a newManagedFunctionContainercontained in thisFlowfor theManagedObjectAdministrationMetaData.- Specified by:
createAdministrationFunctionin interfaceFlow- Type Parameters:
E- Extension type.F-Flowkey type.G-Governancekey type.- Parameters:
adminMetaData-ManagedObjectAdministrationMetaData.parallelFunctionOwner-ManagedFunctionContainerthat is the parallel owner of the newManagedFunction.- Returns:
- New
ManagedFunctionContainer.
-
cancel
public FunctionState cancel()
Description copied from interface:FlowCancels thisFlow.- Specified by:
cancelin interfaceFlow- Returns:
FunctionStateto clean up thisFlow.
-
managedFunctionComplete
public FunctionState managedFunctionComplete(FunctionState function, java.lang.Throwable functionEscalation, EscalationCompletion escalationCompletion)
Description copied from interface:FlowFlags that the inputFunctionStatehas completed.- Specified by:
managedFunctionCompletein interfaceFlow- Parameters:
function-FunctionStatethat has completed.functionEscalation- PossibleEscalationfrom theFunctionState. May benull.escalationCompletion- PossibleEscalationCompletion. May benull.- Returns:
- Optional
FunctionStateto handle completion of theFunctionState.
-
getThreadState
public ThreadState getThreadState()
Description copied from interface:FlowObtains theThreadStatecontaining thisFlow.- Specified by:
getThreadStatein interfaceFlow- Returns:
ThreadStatecontaining thisFlow.
-
-