org.jgroups.util

## Class NullFuture<T>

- java.lang.Object
- - org.jgroups.util.NullFuture<T>

- All Implemented Interfaces:
    java.util.concurrent.Future<T>, NotifyingFuture<T>

      public class NullFuture<T>
      extends java.lang.Object
      implements NotifyingFuture<T>

  Author:
    Bela Ban

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NullFuture(T retval)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel(boolean mayInterruptIfRunning)`
    `T` | `get()`
    `T` | `get(long timeout, java.util.concurrent.TimeUnit unit)`
    `boolean` | `isCancelled()`
    `boolean` | `isDone()`
    `NotifyingFuture` | `setListener(FutureListener<T> listener)` Attaches a listener and returns the same future instance, to allow for 'building' futures.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NullFuture

          public NullFuture(T retval)

  - ### Method Detail

    - #### cancel

          public boolean cancel(boolean mayInterruptIfRunning)

      Specified by:
        `cancel` in interface `java.util.concurrent.Future<T>`

    - #### isCancelled

          public boolean isCancelled()

      Specified by:
        `isCancelled` in interface `java.util.concurrent.Future<T>`

    - #### isDone

          public boolean isDone()

      Specified by:
        `isDone` in interface `java.util.concurrent.Future<T>`

    - #### get

          public T get()
                throws java.lang.InterruptedException,
                       java.util.concurrent.ExecutionException

      Specified by:
        `get` in interface `java.util.concurrent.Future<T>`
      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`

    - #### get

          public T 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<T>`
      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.util.concurrent.TimeoutException`

    - #### setListener

          public NotifyingFuture setListener(FutureListener<T> listener)

      Description copied from interface: `NotifyingFuture`
      Attaches a listener and returns the same future instance, to allow for 'building' futures.
      Specified by:
        `setListener` in interface `NotifyingFuture<T>`
      Parameters:
        `listener` - listener to attach
      Returns:
        the same future instance

Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.