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
A Runnable to execute an assigned Task.
Since:
21.12
Author:
bo
  • Field Details

    • f_sTaskId

      protected final String f_sTaskId
      The identity of the Task to execute.
    • m_task

      protected Task m_task
      The Task to execute.
    • m_cYield

      protected int m_cYield
      The number of times the ClusteredRegistration.TaskExecutor has been yielded.
    • m_fRecovered

      protected boolean m_fRecovered
      Indicates if the Task was previously assigned to a different Executor.
    • m_properties

      protected ClusteredProperties m_properties
      The task Task.Properties.
    • m_executionThread

      protected volatile Thread m_executionThread
      The thread this task is currently running on.
      Since:
      22.06
  • Constructor Details

  • Method Details

    • 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 report
      fComplete - whether execution is completed
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • setResult

      public void setResult(Object result)
      Description copied from interface: Task.Context
      Sets the intermediate result a Task has produced while being executed by an Executor as part of an Task.Orchestration.

      The provided result may be later collected by an TaskExecutorService according to the configured Task.Collector and then published to registered Task.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:
      setResult in interface Task.Context
      Parameters:
      result - the result
    • isDone

      public boolean isDone()
      Description copied from interface: Task.Context
      Determines if a Task completed according to the TaskExecutorService.

      Completion may be due to normal termination, an exception or cancellation. In all of these cases, this method will return true.

      Specified by:
      isDone in interface Task.Context
      Returns:
      true if the Task is considered completed false otherwise
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Task.Context
      Determines if a Task was cancelled.
      Specified by:
      isCancelled in interface Task.Context
      Returns:
      true if the task was cancelled
    • isResuming

      public boolean isResuming()
      Description copied from interface: Task.Context
      Determines if a Task execution by an Executor resuming after being recovered or due to resumption after Task.Yielding.
      Specified by:
      isResuming in interface Task.Context
      Returns:
      true if the Task is
    • getProperties

      public Task.Properties getProperties()
      Description copied from interface: Task.Context
      Obtain the properties of the Task.
      Specified by:
      getProperties in interface Task.Context
      Returns:
      the task properties
    • getTaskId

      public String getTaskId()
      Description copied from interface: Task.Context
      Obtains the unique identity of this Task.
      Specified by:
      getTaskId in interface Task.Context
      Returns:
      the task identity
    • getExecutorId

      public String getExecutorId()
      Description copied from interface: Task.Context
      Obtain the unique identity of the executing Executor.
      Specified by:
      getExecutorId in interface Task.Context
      Returns:
      the executing Executor's identity
    • getExecutionThread

      protected Thread getExecutionThread()
      Returns the Thread this task is currently executing on.
      Returns:
      the Thread this task is currently executing on
    • toString

      public String toString()
      Overrides:
      toString in class Object