Class AbstractFutureTask<R>

  • Type Parameters:
    R -
    All Implemented Interfaces:
    java.lang.Runnable, java.util.concurrent.Future
    Direct Known Subclasses:
    CallbackFutureTask, TaskSequence, TaskStep

    public abstract class AbstractFutureTask<R>
    extends java.lang.Object
    implements java.lang.Runnable, java.util.concurrent.Future
    This is an alternate implementation for FutureTask, which is in some cases not flexible enough.
    • Field Detail

      • Log

        protected static final java.util.logging.Logger Log
    • Constructor Detail

      • AbstractFutureTask

        protected AbstractFutureTask()
    • Method Detail

      • basicGetException

        protected java.lang.Throwable basicGetException()
      • basicGetResult

        protected R basicGetResult()
      • cancel

        public boolean cancel​(boolean interrupt)
        Specified by:
        cancel in interface java.util.concurrent.Future<R>
      • compute

        protected abstract R compute()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • computeAsync

        protected void computeAsync()
      • get

        public R get()
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<R>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public R get​(long pMillisecTimeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException,
                     java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<R>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • getException

        public java.lang.Throwable getException()
      • handleException

        protected final void handleException()
      • handleFinally

        protected final void handleFinally()
      • handleResult

        protected final void handleResult()
      • isActive

        public boolean isActive()
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<R>
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface java.util.concurrent.Future<R>
      • isFailed

        public boolean isFailed()
      • reset

        public void reset()
      • run

        public final void run()
        Specified by:
        run in interface java.lang.Runnable
      • runAsync

        public void runAsync()
      • setException

        protected void setException​(java.lang.Throwable e)
      • setResult

        protected void setResult​(R object)
      • taskCancelled

        protected void taskCancelled()
      • taskFailed

        protected void taskFailed()
      • taskFinally

        protected void taskFinally()
      • taskFinished

        protected void taskFinished()
      • taskStarted

        protected void taskStarted()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • undo

        protected void undo()