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
-
-
-
Method Detail
-
getProcessIdentifier
ProcessIdentifier getProcessIdentifier()
Obtains theProcessIdentifier
for thisProcessState
.- Returns:
ProcessIdentifier
for thisProcessState
.
-
getProcessManager
ProcessManager getProcessManager()
Obtains theProcessManager
for thisProcessState
.- Returns:
ProcessManager
for thisProcessState
.
-
getOfficeManager
OfficeManager getOfficeManager()
Obtains theOfficeManager
for thisProcessState
.- Returns:
OfficeManager
for thisProcessState
.
-
getExecutor
java.util.concurrent.Executor getExecutor()
Obtains theExecutor
for thisProcessState
.- Returns:
Executor
for thisProcessState
.
-
isCancelled
boolean isCancelled()
Indicates if the
ProcessState
has been cancelled.This is only valid after synchronising with this
ProcessState
(in other words the mainThreadState
).- Returns:
true
if cancelled - or indeterminate if have not synchronised onProcessState
.
-
getMainThreadState
ThreadState getMainThreadState()
Obtains the main
ThreadState
for thisProcessState
.The main
ThreadState
is used for anyProcessState
mutations. This avoids the possibility of data corruption, as only oneThreadState
may alter theProcessState
.- Returns:
- Main
ThreadState
for thisProcessState
.
-
spawnThreadState
FunctionState spawnThreadState(ManagedFunctionMetaData<?,?> managedFunctionMetaData, java.lang.Object parameter, FlowCompletion completion, boolean isEscalationHandlingThreadState)
Spawns a newThreadState
contained in thisProcessState
.- Parameters:
managedFunctionMetaData
-ManagedFunctionMetaData
of the initialManagedFunction
within the spawnedThreadState
.parameter
- Parameter for the initialManagedFunction
.completion
- OptionalFlowCompletion
to be notified of completion of the spawnedThreadState
.isEscalationHandlingThreadState
- Indicates whether theThreadState
is forEscalation
handling.- Returns:
FunctionState
to spawn theThreadState
.
-
threadComplete
FunctionState threadComplete(ThreadState thread, FunctionState threadCompletion)
Flags that the inputThreadState
has complete.- Parameters:
thread
-ThreadState
that has completed.threadCompletion
- OptionalFunctionState
for the completion of theThreadState
. May benull
.- Returns:
FunctionState
to complete theThreadState
.
-
getFunctionLoop
FunctionLoop getFunctionLoop()
Obtains theFunctionLoop
for theProcessState
.- Returns:
FunctionLoop
for theProcessState
.
-
getManagedObjectContainer
ManagedObjectContainer getManagedObjectContainer(int index)
Obtains theManagedObjectContainer
for the input index.- Parameters:
index
- Index of theManagedObjectContainer
to be returned.- Returns:
ManagedObjectContainer
for the index.
-
getManagedObjectCleanup
ManagedObjectCleanup getManagedObjectCleanup()
Obtains theManagedObjectCleanup
for thisProcessState
.- Returns:
ManagedObjectCleanup
for thisProcessState
.
-
-