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 FunctionState
cancel()
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 newManagedFunctionContainer
contained in thisFlow
for theManagedObjectAdministrationMetaData
.FunctionState
createFunction(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)
ThreadState
getLinkedListSetOwner()
Obtains the owner of theLinkedListSet
that thisLinkedListSetEntry
may be added.ThreadState
getThreadState()
Obtains theThreadState
containing thisFlow
.FunctionState
managedFunctionComplete(FunctionState function, java.lang.Throwable functionEscalation, EscalationCompletion escalationCompletion)
Flags that the inputFunctionState
has 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
-FlowCompletion
of thisFlow
.escalationCompletion
-EscalationCompletion
for thisFlow
.threadState
-ThreadState
containing thisFlow
.
-
-
Method Detail
-
getLinkedListSetOwner
public ThreadState getLinkedListSetOwner()
Description copied from interface:LinkedListSetEntry
Obtains the owner of the
LinkedListSet
that thisLinkedListSetEntry
may be added.LinkedListSetEntry
instances may only be added to theLinkedListSet
they were intended for and can not be shared betweenLinkedListSet
instances. This constraint:- ensures the integrity of the
FunctionState
,Flow
,ThreadState
,ProcessState
structure, and - improves uniqueness performance as
LinkedListSetEntry.getNext()
andLinkedListSetEntry.getPrev()
both returningnull
indicates not added
- Specified by:
getLinkedListSetOwner
in interfaceLinkedListSetEntry<Flow,ThreadState>
- Returns:
- Owner of the
LinkedListSet
that may contain thisLinkedListSetEntry
.
- ensures the integrity of the
-
createFunction
public FunctionState createFunction(FunctionLogic logic)
Description copied from interface:Flow
- Specified by:
createFunction
in interfaceFlow
- Parameters:
logic
-FunctionLogic
.- Returns:
FunctionState
for 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:
createManagedFunction
in interfaceFlow
- Type Parameters:
O
- Dependency key type.F
-Flow
key type.- Parameters:
parameter
- Parameter for theManagedFunction
.managedFunctionMetaData
-ManagedFunctionMetaData
for the newManagedFunction
.isEnforceGovernance
-true
to enforceGovernance
on deactivation.parallelFunctionOwner
-BlockState
that 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:
createGovernanceFunction
in interfaceFlow
- Type Parameters:
F
-Flow
key 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:Flow
Creates a newManagedFunctionContainer
contained in thisFlow
for theManagedObjectAdministrationMetaData
.- Specified by:
createAdministrationFunction
in interfaceFlow
- Type Parameters:
E
- Extension type.F
-Flow
key type.G
-Governance
key type.- Parameters:
adminMetaData
-ManagedObjectAdministrationMetaData
.parallelFunctionOwner
-ManagedFunctionContainer
that is the parallel owner of the newManagedFunction
.- Returns:
- New
ManagedFunctionContainer
.
-
cancel
public FunctionState cancel()
Description copied from interface:Flow
Cancels thisFlow
.- Specified by:
cancel
in interfaceFlow
- Returns:
FunctionState
to clean up thisFlow
.
-
managedFunctionComplete
public FunctionState managedFunctionComplete(FunctionState function, java.lang.Throwable functionEscalation, EscalationCompletion escalationCompletion)
Description copied from interface:Flow
Flags that the inputFunctionState
has completed.- Specified by:
managedFunctionComplete
in interfaceFlow
- Parameters:
function
-FunctionState
that has completed.functionEscalation
- PossibleEscalation
from theFunctionState
. May benull
.escalationCompletion
- PossibleEscalationCompletion
. May benull
.- Returns:
- Optional
FunctionState
to handle completion of theFunctionState
.
-
getThreadState
public ThreadState getThreadState()
Description copied from interface:Flow
Obtains theThreadState
containing thisFlow
.- Specified by:
getThreadState
in interfaceFlow
- Returns:
ThreadState
containing thisFlow
.
-
-