public class DefaultIoFuture extends Object implements IoFuture
IoFuture
.Constructor and Description |
---|
DefaultIoFuture(IoSession session)
Creates a new instance.
|
DefaultIoFuture(IoSession session,
Object lock)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(IoFutureListener listener)
Adds an event listener which is notified when
the state of this future changes.
|
Object |
getLock()
Returns the lock object this future acquires.
|
IoSession |
getSession()
Returns the
IoSession which is associated with this future. |
protected Object |
getValue()
Returns the result of the asynchronous operation.
|
boolean |
isReady()
Returns if the asynchronous operation is finished.
|
void |
join()
Wait for the asynchronous operation to end.
|
boolean |
join(long timeoutMillis)
Wait for the asynchronous operation to end with the specified timeout.
|
void |
removeListener(IoFutureListener listener)
Removes an existing event listener which is notified when
the state of this future changes.
|
protected void |
setValue(Object newValue)
Sets the result of the asynchronous operation, and mark it as finished.
|
public DefaultIoFuture(IoSession session)
session
- an IoSession
which is associated with this futurepublic IoSession getSession()
IoFuture
IoSession
which is associated with this future.getSession
in interface IoFuture
public Object getLock()
IoFuture
public void join()
IoFuture
public boolean join(long timeoutMillis)
IoFuture
public boolean isReady()
IoFuture
protected void setValue(Object newValue)
protected Object getValue()
public void addListener(IoFutureListener listener)
IoFuture
addListener
in interface IoFuture
public void removeListener(IoFutureListener listener)
IoFuture
removeListener
in interface IoFuture
Copyright © 2004–2015 Apache MINA Project. All rights reserved.