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
AbstractFunctionStatethat delegates functionality to a delegateFunctionState.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionStatedelegateDelegateFunctionState.
-
Constructor Summary
Constructors Constructor Description AbstractDelegateFunctionState(FunctionState delegate)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionStatecancel()FunctionStateexecute(FunctionStateContext context)Executes theFunctionState.FlowgetLinkedListSetOwner()Obtains the owner of theLinkedListSetthat thisLinkedListSetEntrymay be added.TeamManagementgetResponsibleTeam()Obtains theTeamManagementresponsible for thisFunctionState.ThreadStategetThreadState()Obtains theThreadStatefor thisFunctionState.FunctionStatehandleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)HandlesEscalationfrom theManagedFunction.booleanisRequireThreadStateSafety()Indicates if theFunctionStaterequiresThreadStatesafety.java.lang.StringtoString()-
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, wait, wait, wait
-
Methods inherited from interface net.officefloor.frame.internal.structure.LinkedListSetEntry
getNext, getPrev, setNext, setPrev
-
-
-
-
Field Detail
-
delegate
protected final FunctionState delegate
DelegateFunctionState.
-
-
Constructor Detail
-
AbstractDelegateFunctionState
public AbstractDelegateFunctionState(FunctionState delegate)
Instantiate.- Parameters:
delegate- DelegateFunctionState.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLinkedListSetOwner
public 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 interfaceFunctionState- Specified by:
getLinkedListSetOwnerin interfaceLinkedListSetEntry<FunctionState,Flow>- Returns:
- Owner of the
LinkedListSetthat may contain thisLinkedListSetEntry.
- ensures the integrity of the
-
getResponsibleTeam
public TeamManagement 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
public ThreadState 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
public FunctionState execute(FunctionStateContext context) throws java.lang.Throwable
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:
java.lang.Throwable- Possible failure ofFunctionStatelogic.
-
cancel
public FunctionState cancel()
Description copied from interface:FunctionState- Specified by:
cancelin interfaceFunctionState- Returns:
- Optional clean up
FunctionState. May benull.
-
handleEscalation
public FunctionState handleEscalation(java.lang.Throwable escalation, EscalationCompletion completion)
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.
-
-