Class JPPFAnnotatedTask

java.lang.Object
org.jppf.node.protocol.AbstractTask<Object>
org.jppf.client.taskwrapper.JPPFAnnotatedTask
All Implemented Interfaces:
Serializable, Runnable, CancellationHandler, Interruptibility, PositionalElement<Task<Object>>, Task<Object>

public class JPPFAnnotatedTask extends AbstractTask<Object> implements CancellationHandler
JPPF task wrapper for an object whose class is annotated with JPPFRunnable.
Author:
Laurent Cohen
See Also:
  • Field Details

    • taskObjectWrapper

      protected TaskObjectWrapper taskObjectWrapper
      Wrapper around a task that is not an instance of Task.
    • cancelCallback

      protected JPPFTaskCallback<Object> cancelCallback
      A delegate for the onCancel() method.
    • timeoutCallback

      protected JPPFTaskCallback<Object> timeoutCallback
      A delegate for the onTimeout() method.
  • Constructor Details

    • JPPFAnnotatedTask

      public JPPFAnnotatedTask(Object taskObject, Object... args) throws JPPFException
      Initialize this task with an object whose class is either annotated with JPPFRunnable, an instance of Runnable or an instance of Callable.
      Parameters:
      taskObject - an object that encapsulates the task to execute.
      args - the optional arguments for a class that has one of its methods annotated with JPPFRunnable.
      Throws:
      JPPFException - if an error is raised while initializing this task.
    • JPPFAnnotatedTask

      public JPPFAnnotatedTask(Object taskObject, String method, Object... args) throws JPPFException
      Initialize this task from a POJO, given a method and its arguments to execute it.
      Parameters:
      taskObject - either an instance of the POJO class if the method is non-static, or a class object if the method is static.
      method - the name of the method to execute.
      args - the arguments for the method to execute.
      Throws:
      JPPFException - if an error is raised while initializing this task.
  • Method Details