Class AbstractDelegateFunctionState
java.lang.Object
net.officefloor.frame.impl.execute.linkedlistset.AbstractLinkedListSetEntry<FunctionState,Flow>
net.officefloor.frame.impl.execute.function.AbstractDelegateFunctionState
- All Implemented Interfaces:
FunctionState,LinkedListSetEntry<FunctionState,Flow>
- Direct Known Subclasses:
LinkedListSetPromise
public class AbstractDelegateFunctionState
extends AbstractLinkedListSetEntry<FunctionState,Flow>
implements FunctionState
Abstract
FunctionState that delegates functionality to a delegate
FunctionState.- Author:
- Daniel Sagenschneider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancel()execute(FunctionStateContext context) Executes theFunctionState.Obtains the owner of theLinkedListSetthat thisLinkedListSetEntrymay be added.Obtains theTeamManagementresponsible for thisFunctionState.Obtains theThreadStatefor thisFunctionState.handleEscalation(Throwable escalation, EscalationCompletion completion) HandlesEscalationfrom theManagedFunction.booleanIndicates if theFunctionStaterequiresThreadStatesafety.toString()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, wait, wait, waitMethods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
Field Details
-
delegate
DelegateFunctionState.
-
-
Constructor Details
-
AbstractDelegateFunctionState
Instantiate.- Parameters:
delegate- DelegateFunctionState.
-
-
Method Details
-
toString
-
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 interfaceFunctionState- Specified by:
getLinkedListSetOwnerin interfaceLinkedListSetEntry<FunctionState,Flow> - Returns:
- Owner of the
LinkedListSetthat may contain thisLinkedListSetEntry.
- ensures the integrity of the
-
getResponsibleTeam
Description copied from interface:FunctionStateObtains the
TeamManagementresponsible for thisFunctionState.By default,
FunctionStatemay be executed by anyTeamManagement.- Specified by:
getResponsibleTeamin interfaceFunctionState- Returns:
TeamManagementresponsible for thisFunctionState. May benullto indicate anyTeammay execute theFunctionState.
-
getThreadState
Description copied from interface:FunctionStateObtains the
ThreadStatefor thisFunctionState.This provides access to the
ThreadStatethat thisFunctionStateresides within.- Specified by:
getThreadStatein interfaceFunctionState- Returns:
ThreadStatefor thisFunctionState.
-
isRequireThreadStateSafety
public boolean isRequireThreadStateSafety()Description copied from interface:FunctionStateIndicates if theFunctionStaterequiresThreadStatesafety.- Specified by:
isRequireThreadStateSafetyin interfaceFunctionState- Returns:
trueshouldFunctionStaterequireThreadStatesafety.
-
execute
Description copied from interface:FunctionStateExecutes theFunctionState.- Specified by:
executein interfaceFunctionState- Parameters:
context-FunctionStateContextfor executing theFunctionState.- Returns:
- Next
FunctionStateto be executed. May benullto indicate no furtherFunctionStateinstances to execute. - Throws:
Throwable- Possible failure ofFunctionStatelogic.
-
cancel
Description copied from interface:FunctionState- Specified by:
cancelin interfaceFunctionState- Returns:
- Optional clean up
FunctionState. May benull.
-
handleEscalation
Description copied from interface:FunctionStateHandlesEscalationfrom theManagedFunction.- Specified by:
handleEscalationin interfaceFunctionState- Parameters:
escalation-Escalation.completion- OptionalEscalationCompletionto be notified onceEscalationhas been handled.- Returns:
- Optional
FunctionStateto handle theEscalation.
-