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>
Implementation of the
Flow.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionFlowImpl(FlowCompletion flowCompletion, EscalationCompletion escalationCompletion, ThreadState threadState) Initiate. -
Method Summary
Modifier and TypeMethodDescriptioncancel()Cancels thisFlow.<E,F extends Enum<F>, G extends Enum<G>>
ManagedFunctionContainercreateAdministrationFunction(ManagedObjectAdministrationMetaData<E, F, G> adminMetaData, ManagedFunctionContainer parallelFunctionOwner) Creates a newManagedFunctionContainercontained in thisFlowfor theManagedObjectAdministrationMetaData.createFunction(FunctionLogic logic) <F extends Enum<F>>
ManagedFunctionContainercreateGovernanceFunction(GovernanceActivity<F> governanceActivity, GovernanceMetaData<?, F> governanceMetaData) <O extends Enum<O>,F extends Enum<F>>
ManagedFunctionContainercreateManagedFunction(Object parameter, ManagedFunctionMetaData<O, F> managedFunctionMetaData, boolean isEnforceGovernance, BlockState parallelFunctionOwner) Obtains the owner of theLinkedListSetthat thisLinkedListSetEntrymay be added.Obtains theThreadStatecontaining thisFlow.managedFunctionComplete(FunctionState function, Throwable functionEscalation, EscalationCompletion escalationCompletion) Flags that the inputFunctionStatehas completed.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, toString, wait, wait, waitMethods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
Constructor Details
-
FlowImpl
public FlowImpl(FlowCompletion flowCompletion, EscalationCompletion escalationCompletion, ThreadState threadState) Initiate.- Parameters:
flowCompletion-FlowCompletionof thisFlow.escalationCompletion-EscalationCompletionfor thisFlow.threadState-ThreadStatecontaining thisFlow.
-
-
Method Details
-
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
Description copied from interface:Flow- Specified by:
createFunctionin interfaceFlow- Parameters:
logic-FunctionLogic.- Returns:
FunctionStatefor theFunctionLogic.
-
createManagedFunction
public <O extends Enum<O>,F extends Enum<F>> ManagedFunctionContainer createManagedFunction(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 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 Enum<F>, ManagedFunctionContainer createAdministrationFunctionG extends Enum<G>> (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
Description copied from interface:FlowCancels thisFlow.- Specified by:
cancelin interfaceFlow- Returns:
FunctionStateto clean up thisFlow.
-
managedFunctionComplete
public FunctionState managedFunctionComplete(FunctionState function, 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
Description copied from interface:FlowObtains theThreadStatecontaining thisFlow.- Specified by:
getThreadStatein interfaceFlow- Returns:
ThreadStatecontaining thisFlow.
-