Class ClientFuture<V>

    • Method Detail

      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<V>
      • isFailed

        public boolean isFailed()
        Returns:
        true if the Future operation failed.
      • getResult

        public V getResult()
        Returns:
        the resulting value of the operation upon successful completion.
      • isCancelled

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

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

        public boolean isComplete()
        Description copied from interface: AsyncResult
        Returns true if the AsyncResult has completed. The task is considered complete regardless if it succeeded or failed.
        Specified by:
        isComplete in interface AsyncResult<V>
        Returns:
        returns true if the asynchronous operation has completed.
      • isNotComplete

        protected boolean isNotComplete()
      • getState

        protected int getState()
        Returns:
        the current ClientFuture state as if this call.
      • failed

        public void failed​(ClientException result)
        Description copied from interface: AsyncResult
        If the operation fails this method is invoked with the Exception that caused the failure.
        Specified by:
        failed in interface AsyncResult<V>
        Parameters:
        result - The error that resulted in this asynchronous operation failing.
      • complete

        public void complete​(V result)
        Description copied from interface: AsyncResult
        If the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.
        Specified by:
        complete in interface AsyncResult<V>
        Parameters:
        result - the object that completes the future.
      • get

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

        public abstract V get​(long timeout,
                              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<V>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • tryCancelTask

        protected void tryCancelTask()
        TODO - Provide hook to run on the event loop to do whatever it means to cancel this task and update the task state in a thread safe manner.