|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.netty.channel.DefaultChannelFuture
public class DefaultChannelFuture
The default ChannelFuture
implementation. It is recommended to
use Channels.future(Channel)
and Channels.future(Channel, boolean)
to create a new ChannelFuture
rather than calling the constructor
explicitly.
Constructor Summary | |
---|---|
DefaultChannelFuture(Channel channel,
boolean cancellable)
Creates a new instance. |
Method Summary | |
---|---|
void |
addListener(ChannelFutureListener listener)
Adds the specified listener to this future. |
ChannelFuture |
await()
Waits for this future to be completed. |
boolean |
await(long timeoutMillis)
Waits for this future to be completed within the specified time limit. |
boolean |
await(long timeout,
TimeUnit unit)
Waits for this future to be completed within the specified time limit. |
ChannelFuture |
awaitUninterruptibly()
Waits for this future to be completed without interruption. |
boolean |
awaitUninterruptibly(long timeoutMillis)
Waits for this future to be completed within the specified time limit without interruption. |
boolean |
awaitUninterruptibly(long timeout,
TimeUnit unit)
Waits for this future to be completed within the specified time limit without interruption. |
boolean |
cancel()
Cancels the I/O operation associated with this future and notifies all listeners if canceled successfully. |
Throwable |
getCause()
Returns the cause of the failed I/O operation if the I/O operation has failed. |
Channel |
getChannel()
Returns a channel where the I/O operation associated with this future takes place. |
boolean |
isCancelled()
Returns true if and only if this future was
cancelled by a ChannelFuture.cancel() method. |
boolean |
isDone()
Returns true if and only if this future is
complete, regardless of whether the operation was successful, failed,
or cancelled. |
boolean |
isSuccess()
Returns true if and only if the I/O operation was completed
successfully. |
static boolean |
isUseDeadLockChecker()
Returns true if and only if the dead lock checker is enabled. |
void |
removeListener(ChannelFutureListener listener)
Removes the specified listener from this future. |
boolean |
setFailure(Throwable cause)
Marks this future as a failure and notifies all listeners. |
boolean |
setSuccess()
Marks this future as a success and notifies all listeners. |
static void |
setUseDeadLockChecker(boolean useDeadLockChecker)
Enables or disables the dead lock checker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultChannelFuture(Channel channel, boolean cancellable)
channel
- the Channel
associated with this futurecancellable
- true
if and only if this future can be canceledMethod Detail |
---|
public static boolean isUseDeadLockChecker()
true
if and only if the dead lock checker is enabled.
public static void setUseDeadLockChecker(boolean useDeadLockChecker)
public Channel getChannel()
ChannelFuture
getChannel
in interface ChannelFuture
public boolean isDone()
ChannelFuture
true
if and only if this future is
complete, regardless of whether the operation was successful, failed,
or cancelled.
isDone
in interface ChannelFuture
public boolean isSuccess()
ChannelFuture
true
if and only if the I/O operation was completed
successfully.
isSuccess
in interface ChannelFuture
public Throwable getCause()
ChannelFuture
getCause
in interface ChannelFuture
null
if succeeded or this future is not
completed yet.public boolean isCancelled()
ChannelFuture
true
if and only if this future was
cancelled by a ChannelFuture.cancel()
method.
isCancelled
in interface ChannelFuture
public void addListener(ChannelFutureListener listener)
ChannelFuture
addListener
in interface ChannelFuture
public void removeListener(ChannelFutureListener listener)
ChannelFuture
removeListener
in interface ChannelFuture
public ChannelFuture await() throws InterruptedException
ChannelFuture
await
in interface ChannelFuture
InterruptedException
- if the current thread was interruptedpublic boolean await(long timeout, TimeUnit unit) throws InterruptedException
ChannelFuture
await
in interface ChannelFuture
true
if and only if the future was completed within
the specified time limit
InterruptedException
- if the current thread was interruptedpublic boolean await(long timeoutMillis) throws InterruptedException
ChannelFuture
await
in interface ChannelFuture
true
if and only if the future was completed within
the specified time limit
InterruptedException
- if the current thread was interruptedpublic ChannelFuture awaitUninterruptibly()
ChannelFuture
InterruptedException
and
discards it silently.
awaitUninterruptibly
in interface ChannelFuture
public boolean awaitUninterruptibly(long timeout, TimeUnit unit)
ChannelFuture
InterruptedException
and discards it silently.
awaitUninterruptibly
in interface ChannelFuture
true
if and only if the future was completed within
the specified time limitpublic boolean awaitUninterruptibly(long timeoutMillis)
ChannelFuture
InterruptedException
and discards it silently.
awaitUninterruptibly
in interface ChannelFuture
true
if and only if the future was completed within
the specified time limitpublic boolean setSuccess()
ChannelFuture
setSuccess
in interface ChannelFuture
true
if and only if successfully marked this future as
a success. Otherwise false
because this future is
already marked as either a success or a failure.public boolean setFailure(Throwable cause)
ChannelFuture
setFailure
in interface ChannelFuture
true
if and only if successfully marked this future as
a failure. Otherwise false
because this future is
already marked as either a success or a failure.public boolean cancel()
ChannelFuture
cancel
in interface ChannelFuture
true
if and only if the operation has been canceled.
false
if the operation can't be canceled or is already
completed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |