org.atmosphere.wasync.util
Class FutureProxy<T extends Future>

java.lang.Object
  extended by org.atmosphere.wasync.util.FutureProxy<T>
All Implemented Interfaces:
Future<Socket>

public class FutureProxy<T extends Future>
extends Object
implements Future


Constructor Summary
FutureProxy(Socket socket, T proxyiedFuture)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 void close()
          Close the underlying Socket
 void done()
          Mark this instance as done.
 Future finishOrThrowException()
          Mark the future done.
 Future fire(Object data)
          Send data to the remote Server.
 Socket get()
           
 Socket get(long timeout, TimeUnit unit)
           
 Future ioException(IOException t)
          If an exception occurs, the Transport will set it using this method.
 boolean isCancelled()
           
 boolean isDone()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureProxy

public FutureProxy(Socket socket,
                   T proxyiedFuture)
Method Detail

fire

public Future fire(Object data)
            throws IOException
Description copied from interface: Future
Send data to the remote Server.

Parameters:
data - the message to fire
Returns:
a Future
Throws:
IOException

finishOrThrowException

public Future finishOrThrowException()
                              throws IOException
Description copied from interface: Future
Mark the future done. If an exception occurred, this method will throw it.

Returns:
a Future
Throws:
IOException

ioException

public Future ioException(IOException t)
Description copied from interface: Future
If an exception occurs, the Transport will set it using this method. An application can also use that method to interrupt a blocking Socket.open(Request) operation. This operation must unlock the current blocked thread.

Parameters:
t - a IOException
Returns:
a Future

done

public void done()
Description copied from interface: Future
Mark this instance as done.


cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<Socket>

isCancelled

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

isDone

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

get

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

get

public Socket get(long timeout,
                  TimeUnit unit)
           throws InterruptedException,
                  ExecutionException,
                  TimeoutException
Specified by:
get in interface Future<Socket>
Throws:
InterruptedException
ExecutionException
TimeoutException

close

public void close()
Description copied from interface: Future
Close the underlying Socket



Copyright © 2014. All Rights Reserved.