Class DefaultFuture<T extends DefaultFuture<?>>

  • Direct Known Subclasses:
    AbstractDownloadTask

    public class DefaultFuture<T extends DefaultFuture<?>>
    extends Object
    A simple future
    • Constructor Detail

      • DefaultFuture

        public DefaultFuture()
      • DefaultFuture

        public DefaultFuture​(Object lock)
        Creates a new instance.
        Parameters:
        lock - the future lock.
    • Method Detail

      • awaitUninterruptibly

        public T awaitUninterruptibly()
      • awaitUninterruptibly

        public boolean awaitUninterruptibly​(long timeout,
                                            TimeUnit unit)
      • awaitUninterruptibly

        public boolean awaitUninterruptibly​(long timeoutMillis)
      • isDone

        public boolean isDone()
      • setValue

        public void setValue​(Object newValue)
        Set the result of the asynchronous operation, and mark it as finished.
        Parameters:
        newValue - the result of the asynchronous operation.
      • getValue

        protected Object getValue()
        Return the result of the asynchronous operation.
        Returns:
        the result of the asynchronous operation.
      • isCanceled

        public boolean isCanceled()
      • cancel

        public void cancel()