Interface ProcessState
- All Known Implementing Classes:
ProcessStateImpl
public interface ProcessState
State of a process within the Office.
ProcessState instances can not interact with each other, much like
processes within an Operating System can not directly interact (e.g. share
process space) with each other.
- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionObtains theExecutorfor thisProcessState.Obtains theFunctionLoopfor theProcessState.Obtains the mainThreadStatefor thisProcessState.Obtains theManagedObjectCleanupfor thisProcessState.getManagedObjectContainer(int index) Obtains theManagedObjectContainerfor the input index.Obtains theOfficeManagerfor thisProcessState.Obtains theProcessIdentifierfor thisProcessState.Obtains theProcessManagerfor thisProcessState.booleanIndicates if theProcessStatehas been cancelled.spawnThreadState(ManagedFunctionMetaData<?, ?> managedFunctionMetaData, Object parameter, FlowCompletion completion, boolean isEscalationHandlingThreadState) Spawns a newThreadStatecontained in thisProcessState.threadComplete(ThreadState thread, FunctionState threadCompletion) Flags that the inputThreadStatehas complete.
-
Method Details
-
getProcessIdentifier
ProcessIdentifier getProcessIdentifier()Obtains theProcessIdentifierfor thisProcessState.- Returns:
ProcessIdentifierfor thisProcessState.
-
getProcessManager
ProcessManager getProcessManager()Obtains theProcessManagerfor thisProcessState.- Returns:
ProcessManagerfor thisProcessState.
-
getOfficeManager
OfficeManager getOfficeManager()Obtains theOfficeManagerfor thisProcessState.- Returns:
OfficeManagerfor thisProcessState.
-
getExecutor
Executor getExecutor()Obtains theExecutorfor thisProcessState.- Returns:
Executorfor thisProcessState.
-
isCancelled
boolean isCancelled()Indicates if the
ProcessStatehas been cancelled.This is only valid after synchronising with this
ProcessState(in other words the mainThreadState).- Returns:
trueif cancelled - or indeterminate if have not synchronised onProcessState.
-
getMainThreadState
ThreadState getMainThreadState()Obtains the main
ThreadStatefor thisProcessState.The main
ThreadStateis used for anyProcessStatemutations. This avoids the possibility of data corruption, as only oneThreadStatemay alter theProcessState.- Returns:
- Main
ThreadStatefor thisProcessState.
-
spawnThreadState
FunctionState spawnThreadState(ManagedFunctionMetaData<?, ?> managedFunctionMetaData, Object parameter, FlowCompletion completion, boolean isEscalationHandlingThreadState) Spawns a newThreadStatecontained in thisProcessState.- Parameters:
managedFunctionMetaData-ManagedFunctionMetaDataof the initialManagedFunctionwithin the spawnedThreadState.parameter- Parameter for the initialManagedFunction.completion- OptionalFlowCompletionto be notified of completion of the spawnedThreadState.isEscalationHandlingThreadState- Indicates whether theThreadStateis forEscalationhandling.- Returns:
FunctionStateto spawn theThreadState.
-
threadComplete
Flags that the inputThreadStatehas complete.- Parameters:
thread-ThreadStatethat has completed.threadCompletion- OptionalFunctionStatefor the completion of theThreadState. May benull.- Returns:
FunctionStateto complete theThreadState.
-
getFunctionLoop
FunctionLoop getFunctionLoop()Obtains theFunctionLoopfor theProcessState.- Returns:
FunctionLoopfor theProcessState.
-
getManagedObjectContainer
Obtains theManagedObjectContainerfor the input index.- Parameters:
index- Index of theManagedObjectContainerto be returned.- Returns:
ManagedObjectContainerfor the index.
-
getManagedObjectCleanup
ManagedObjectCleanup getManagedObjectCleanup()Obtains theManagedObjectCleanupfor thisProcessState.- Returns:
ManagedObjectCleanupfor thisProcessState.
-