Class ClusteredRegistration.TaskExecutor
java.lang.Object
com.oracle.coherence.concurrent.executor.ClusteredRegistration.TaskExecutor
- All Implemented Interfaces:
Task.Context,Runnable
- Enclosing class:
ClusteredRegistration
- Since:
- 21.12
- Author:
- bo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe identity of theTaskto execute.protected intThe number of times theClusteredRegistration.TaskExecutorhas been yielded.protected ThreadThe thread this task is currently running on.protected booleanprotected ClusteredPropertiesThe taskTask.Properties.protected TaskTheTaskto execute. -
Constructor Summary
ConstructorsConstructorDescriptionTaskExecutor(String sTaskId, boolean fRecovered) Constructs aClusteredRegistration.TaskExecutor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ThreadReturns theThreadthis task is currently executing on.Obtain the unique identity of the executingExecutor.Obtain the properties of theTask.Obtains the unique identity of thisTask.booleanDetermines if aTaskwas cancelled.booleanisDone()Determines if aTaskcompleted according to theTaskExecutorService.booleanDetermines if aTaskexecution by anExecutorresuming after being recovered or due to resumption afterTask.Yielding.voidrun()voidSet the result processing result.voidSet the result processing result.voidSets the intermediate result aTaskhas produced while being executed by anExecutoras part of anTask.Orchestration.toString()
-
Field Details
-
f_sTaskId
-
m_task
-
m_cYield
protected int m_cYieldThe number of times theClusteredRegistration.TaskExecutorhas been yielded. -
m_fRecovered
-
m_properties
The taskTask.Properties. -
m_executionThread
The thread this task is currently running on.- Since:
- 22.06
-
-
Constructor Details
-
TaskExecutor
Constructs aClusteredRegistration.TaskExecutor.
-
-
Method Details
-
setResult
Set the result processing result.- Parameters:
result- the result to report
-
setResult
Set the result processing result.- Parameters:
result- the result to reportfComplete- whether execution is completed
-
run
-
setResult
Description copied from interface:Task.ContextSets the intermediate result aTaskhas produced while being executed by anExecutoras part of anTask.Orchestration.The provided result may be later collected by an
TaskExecutorServiceaccording to the configuredTask.Collectorand then published to registeredTask.Subscribers.Multiple calls to this method are permitted during the execution of a
Task, thus permitting a stream of results to be collected and thus published.- Specified by:
setResultin interfaceTask.Context- Parameters:
result- the result
-
isDone
public boolean isDone()Description copied from interface:Task.ContextDetermines if aTaskcompleted according to theTaskExecutorService.Completion may be due to normal termination, an exception or cancellation. In all of these cases, this method will return
true.- Specified by:
isDonein interfaceTask.Context- Returns:
trueif theTaskis considered completedfalseotherwise
-
isCancelled
public boolean isCancelled()Description copied from interface:Task.ContextDetermines if aTaskwas cancelled.- Specified by:
isCancelledin interfaceTask.Context- Returns:
trueif the task was cancelled
-
isResuming
public boolean isResuming()Description copied from interface:Task.ContextDetermines if aTaskexecution by anExecutorresuming after being recovered or due to resumption afterTask.Yielding.- Specified by:
isResumingin interfaceTask.Context- Returns:
trueif theTaskis
-
getProperties
Description copied from interface:Task.ContextObtain the properties of theTask.- Specified by:
getPropertiesin interfaceTask.Context- Returns:
- the task properties
-
getTaskId
Description copied from interface:Task.ContextObtains the unique identity of thisTask.- Specified by:
getTaskIdin interfaceTask.Context- Returns:
- the task identity
-
getExecutorId
Description copied from interface:Task.ContextObtain the unique identity of the executingExecutor.- Specified by:
getExecutorIdin interfaceTask.Context- Returns:
- the executing
Executor's identity
-
getExecutionThread
-
toString
-