org.atmosphere.cpr
Class BroadcasterFuture<E>

java.lang.Object
  extended by org.atmosphere.cpr.BroadcasterFuture<E>
All Implemented Interfaces:
Future

public class BroadcasterFuture<E>
extends Object
implements Future

Simple Future that can be used when awiting for a Broadcaster to finish it's broadcast operations to AtmosphereHandler

Author:
Jeanfrancois Arcand

Constructor Summary
BroadcasterFuture(E msg)
           
 
Method Summary
 boolean cancel(boolean b)
          Cancel
 void done()
          Invoked when a Broadcaster completed it broadcast operation.
 E get()
          Block until a Broadcaster completed it broadcast operation.
 E get(long l, TimeUnit tu)
          Block until a Broadcaster completed it broadcast operation.
 boolean isCancelled()
          True is cancelled.
 boolean isDone()
          True when done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadcasterFuture

public BroadcasterFuture(E msg)
Method Detail

cancel

public boolean cancel(boolean b)
Cancel

Specified by:
cancel in interface Future
Parameters:
b -
Returns:

isCancelled

public boolean isCancelled()
True is cancelled.

Specified by:
isCancelled in interface Future
Returns:

isDone

public boolean isDone()
True when done.

Specified by:
isDone in interface Future

done

public void done()
Invoked when a Broadcaster completed it broadcast operation.


get

public E get()
      throws InterruptedException,
             ExecutionException
Block until a Broadcaster completed it broadcast operation.

Specified by:
get in interface Future
Returns:
The filtered message.
Throws:
InterruptedException
ExecutionException

get

public E get(long l,
             TimeUnit tu)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Block until a Broadcaster completed it broadcast operation.

Specified by:
get in interface Future
Parameters:
l - The time to wait.
tu - TimeUnit
Returns:
The filtered message.
Throws:
InterruptedException
ExecutionException
TimeoutException


Copyright © 2010 SUN Microsystems. All Rights Reserved.