Interface FunctionState
-
- All Superinterfaces:
LinkedListSetEntry<FunctionState,Flow>
- All Known Subinterfaces:
AssetManager
,BlockState
,ManagedFunctionContainer
,RegisteredGovernance
,ThreadProfiler
- All Known Implementing Classes:
AbstractDelegateFunctionState
,AbstractFunctionState
,AssetManagerImpl
,LinkedListSetPromise
,ManagedFunctionContainerImpl
,ThreadProfilerImpl
public interface FunctionState extends LinkedListSetEntry<FunctionState,Flow>
Node within the graph ofFunctionState
instances to execute.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default FunctionState
cancel()
FunctionState
execute(FunctionStateContext context)
Executes theFunctionState
.default Flow
getLinkedListSetOwner()
Obtains the owner of theLinkedListSet
that thisLinkedListSetEntry
may be added.default TeamManagement
getResponsibleTeam()
Obtains theTeamManagement
responsible for thisFunctionState
.ThreadState
getThreadState()
Obtains theThreadState
for thisFunctionState
.default FunctionState
handleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)
HandlesEscalation
from theManagedFunction
.default boolean
isRequireThreadStateSafety()
Indicates if theFunctionState
requiresThreadState
safety.-
Methods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
-
-
-
Method Detail
-
getLinkedListSetOwner
default Flow 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<FunctionState,Flow>
- Returns:
- Owner of the
LinkedListSet
that may contain thisLinkedListSetEntry
.
- ensures the integrity of the
-
getResponsibleTeam
default TeamManagement getResponsibleTeam()
Obtains the
TeamManagement
responsible for thisFunctionState
.By default,
FunctionState
may be executed by anyTeamManagement
.- Returns:
TeamManagement
responsible for thisFunctionState
. May benull
to indicate anyTeam
may execute theFunctionState
.
-
getThreadState
ThreadState getThreadState()
Obtains the
ThreadState
for thisFunctionState
.This provides access to the
ThreadState
that thisFunctionState
resides within.- Returns:
ThreadState
for thisFunctionState
.
-
isRequireThreadStateSafety
default boolean isRequireThreadStateSafety()
Indicates if theFunctionState
requiresThreadState
safety.- Returns:
true
shouldFunctionState
requireThreadState
safety.
-
execute
FunctionState execute(FunctionStateContext context) throws java.lang.Throwable
Executes theFunctionState
.- Parameters:
context
-FunctionStateContext
for executing theFunctionState
.- Returns:
- Next
FunctionState
to be executed. May benull
to indicate no furtherFunctionState
instances to execute. - Throws:
java.lang.Throwable
- Possible failure ofFunctionState
logic.
-
cancel
default FunctionState cancel()
- Returns:
- Optional clean up
FunctionState
. May benull
.
-
handleEscalation
default FunctionState handleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)
HandlesEscalation
from theManagedFunction
.- Parameters:
escalation
-Escalation
.completion
- OptionalEscalationCompletion
to be notified onceEscalation
has been handled.- Returns:
- Optional
FunctionState
to handle theEscalation
.
-
-