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 ofFunctionStateinstances to execute.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default FunctionStatecancel()FunctionStateexecute(FunctionStateContext context)Executes theFunctionState.default FlowgetLinkedListSetOwner()Obtains the owner of theLinkedListSetthat thisLinkedListSetEntrymay be added.default TeamManagementgetResponsibleTeam()Obtains theTeamManagementresponsible for thisFunctionState.ThreadStategetThreadState()Obtains theThreadStatefor thisFunctionState.default FunctionStatehandleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)HandlesEscalationfrom theManagedFunction.default booleanisRequireThreadStateSafety()Indicates if theFunctionStaterequiresThreadStatesafety.-
Methods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
-
-
-
Method Detail
-
getLinkedListSetOwner
default 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 interfaceLinkedListSetEntry<FunctionState,Flow>- Returns:
- Owner of the
LinkedListSetthat may contain thisLinkedListSetEntry.
- ensures the integrity of the
-
getResponsibleTeam
default TeamManagement getResponsibleTeam()
Obtains the
TeamManagementresponsible for thisFunctionState.By default,
FunctionStatemay be executed by anyTeamManagement.- Returns:
TeamManagementresponsible for thisFunctionState. May benullto indicate anyTeammay execute theFunctionState.
-
getThreadState
ThreadState getThreadState()
Obtains the
ThreadStatefor thisFunctionState.This provides access to the
ThreadStatethat thisFunctionStateresides within.- Returns:
ThreadStatefor thisFunctionState.
-
isRequireThreadStateSafety
default boolean isRequireThreadStateSafety()
Indicates if theFunctionStaterequiresThreadStatesafety.- Returns:
trueshouldFunctionStaterequireThreadStatesafety.
-
execute
FunctionState execute(FunctionStateContext context) throws java.lang.Throwable
Executes theFunctionState.- Parameters:
context-FunctionStateContextfor executing theFunctionState.- Returns:
- Next
FunctionStateto be executed. May benullto indicate no furtherFunctionStateinstances to execute. - Throws:
java.lang.Throwable- Possible failure ofFunctionStatelogic.
-
cancel
default FunctionState cancel()
- Returns:
- Optional clean up
FunctionState. May benull.
-
handleEscalation
default FunctionState handleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)
HandlesEscalationfrom theManagedFunction.- Parameters:
escalation-Escalation.completion- OptionalEscalationCompletionto be notified onceEscalationhas been handled.- Returns:
- Optional
FunctionStateto handle theEscalation.
-
-