org.infinispan.util.concurrent
Class NoOpFuture<E>

java.lang.Object
  extended by org.infinispan.util.concurrent.NoOpFuture<E>
All Implemented Interfaces:
Future<E>, NotifyingFuture<E>, NotifyingNotifiableFuture<E>

public class NoOpFuture<E>
extends Object
implements NotifyingNotifiableFuture<E>

A future that doesn't do anything and simply returns a given return value.

Since:
5.1
Author:
Manik Surtani

Constructor Summary
NoOpFuture(E returnValue)
           
 
Method Summary
 NotifyingFuture<E> attachListener(FutureListener<E> eFutureListener)
          Attaches a listener and returns the same future instance, to allow for 'building'.
 boolean cancel(boolean b)
           
 E get()
           
 E get(long l, TimeUnit timeUnit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 void notifyDone()
           
 void setNetworkFuture(Future<E> eFuture)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpFuture

public NoOpFuture(E returnValue)
Method Detail

cancel

public boolean cancel(boolean b)
Specified by:
cancel in interface Future<E>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<E>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<E>

get

public E get()
      throws InterruptedException,
             ExecutionException
Specified by:
get in interface Future<E>
Throws:
InterruptedException
ExecutionException

get

public E get(long l,
             TimeUnit timeUnit)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Specified by:
get in interface Future<E>
Throws:
InterruptedException
ExecutionException
TimeoutException

notifyDone

public void notifyDone()
Specified by:
notifyDone in interface NotifyingNotifiableFuture<E>

setNetworkFuture

public void setNetworkFuture(Future<E> eFuture)
Specified by:
setNetworkFuture in interface NotifyingNotifiableFuture<E>

attachListener

public NotifyingFuture<E> attachListener(FutureListener<E> eFutureListener)
Description copied from interface: NotifyingFuture
Attaches a listener and returns the same future instance, to allow for 'building'.

Specified by:
attachListener in interface NotifyingFuture<E>
Parameters:
eFutureListener - listener to attach
Returns:
the same future instance

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.