org.atmosphere.wasync.impl
Class DefaultFuture

java.lang.Object
  extended by org.atmosphere.wasync.impl.DefaultFuture
All Implemented Interfaces:
Future<Socket>

public class DefaultFuture
extends Object
implements Future


Field Summary
protected  TimeoutException te
           
protected  long time
           
protected  TimeUnit tu
           
 
Constructor Summary
DefaultFuture(DefaultSocket socket)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
          
 Future done()
          Mark the future done.
 Future fire(Object data)
          Send data to the remote Server.
 Socket get()
          
 Socket get(long timeout, TimeUnit unit)
          
 boolean isCancelled()
          
 boolean isDone()
          
protected  void reset()
           
protected  Socket socket()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

time

protected long time

tu

protected TimeUnit tu

te

protected TimeoutException te
Constructor Detail

DefaultFuture

public DefaultFuture(DefaultSocket socket)
Method Detail

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>

done

public Future done()
Mark the future done.

Returns:
a Future

reset

protected void reset()

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

socket

protected Socket socket()

fire

public Future fire(Object data)
            throws IOException
Send data to the remote Server.

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


Copyright © 2013. All Rights Reserved.