Class ClusteredRegistration.TaskExecutor
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.ClusteredRegistration.TaskExecutor
-
- All Implemented Interfaces:
Task.Context,Runnable
- Enclosing class:
- ClusteredRegistration
protected class ClusteredRegistration.TaskExecutor extends Object implements Runnable, Task.Context
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanf_fRecoveredprotected Stringf_sTaskIdThe identity of theTaskto execute.protected intm_cYieldThe number of times theClusteredRegistration.TaskExecutorhas been yielded.protected ClusteredPropertiesm_propertiesThe taskTask.Properties.protected Taskm_taskTheTaskto execute.
-
Constructor Summary
Constructors Constructor Description TaskExecutor(String sTaskId, boolean fRecovered)Constructs aClusteredRegistration.TaskExecutor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetExecutorId()Obtain the unique identity of the executingExecutor.Task.PropertiesgetProperties()Obtain the properties of theTask.StringgetTaskId()Obtains the unique identity of thisTask.booleanisDone()Determines if aTaskcompleted according to theTaskExecutorService.booleanisResuming()Determines if aTaskexecution by anExecutorresuming after being recovered or due to resumption afterTask.Yielding.voidrun()voidsetResult(Result result)Set the result processing result.voidsetResult(Result result, boolean fComplete)Set the result processing result.voidsetResult(Object result)Sets the intermediate result aTaskhas produced while being executed by anExecutoras part of anTask.Orchestration.
-
-
-
Field Detail
-
m_cYield
protected int m_cYield
The number of times theClusteredRegistration.TaskExecutorhas been yielded.
-
f_fRecovered
protected final boolean f_fRecovered
-
m_properties
protected ClusteredProperties m_properties
The taskTask.Properties.
-
-
Constructor Detail
-
TaskExecutor
public TaskExecutor(String sTaskId, boolean fRecovered)
Constructs aClusteredRegistration.TaskExecutor.
-
-
Method Detail
-
setResult
public void setResult(Result result)
Set the result processing result.- Parameters:
result- the result to report
-
setResult
public void setResult(Result result, boolean fComplete)
Set the result processing result.- Parameters:
result- the result to reportfComplete- whether execution is completed
-
setResult
public void setResult(Object result)
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 is 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
-
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
public Task.Properties getProperties()
Description copied from interface:Task.ContextObtain the properties of theTask.- Specified by:
getPropertiesin interfaceTask.Context- Returns:
- the task properties
-
getTaskId
public String getTaskId()
Description copied from interface:Task.ContextObtains the unique identity of thisTask.- Specified by:
getTaskIdin interfaceTask.Context- Returns:
- the task identity
-
getExecutorId
public String getExecutorId()
Description copied from interface:Task.ContextObtain the unique identity of the executingExecutor.- Specified by:
getExecutorIdin interfaceTask.Context- Returns:
- the executing
Executor's identity
-
-