@UnstableApi public final class VoidChannelPromise extends AbstractFuture<java.lang.Void> implements ChannelPromise
| 构造器和说明 |
|---|
VoidChannelPromise(Channel channel,
boolean fireException)
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
VoidChannelPromise |
addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Adds the specified listener to this future.
|
VoidChannelPromise |
addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Adds the specified listeners to this future.
|
VoidChannelPromise |
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,
java.util.concurrent.TimeUnit unit)
Waits for this future to be completed within the
specified time limit.
|
VoidChannelPromise |
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,
java.util.concurrent.TimeUnit unit)
Waits for this future to be completed within the
specified time limit without interruption.
|
boolean |
cancel(boolean mayInterruptIfRunning)
If the cancellation was successful it will fail the future with a
CancellationException. |
java.lang.Throwable |
cause()
Returns the cause of the failed I/O operation if the I/O operation has
failed.
|
Channel |
channel()
Returns a channel where the I/O operation associated with this
future takes place.
|
java.lang.Void |
getNow()
Return the result without blocking.
|
boolean |
isCancellable()
returns
true if and only if the operation can be cancelled via Future.cancel(boolean). |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isSuccess()
Returns
true if and only if the I/O operation was completed
successfully. |
boolean |
isVoid()
Returns
true if this ChannelFuture is a void future and so not allow to call any of the
following methods:
ChannelFuture.addListener(GenericFutureListener)
ChannelFuture.addListeners(GenericFutureListener[])
ChannelFuture.await()
Future.await(long, TimeUnit) ()}
Future.await(long) ()}
ChannelFuture.awaitUninterruptibly()
ChannelFuture.sync()
ChannelFuture.syncUninterruptibly()
|
VoidChannelPromise |
removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Removes the first occurrence of the specified listener from this future.
|
VoidChannelPromise |
removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
VoidChannelPromise |
setFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
VoidChannelPromise |
setSuccess() |
VoidChannelPromise |
setSuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
boolean |
setUncancellable()
Make this future impossible to cancel.
|
VoidChannelPromise |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
VoidChannelPromise |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
boolean |
tryFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
boolean |
trySuccess() |
boolean |
trySuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
ChannelPromise |
unvoid()
|
get, getpublic VoidChannelPromise addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureaddListener 在接口中 ChannelFutureaddListener 在接口中 ChannelPromiseaddListener 在接口中 Promise<java.lang.Void>public VoidChannelPromise addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureaddListeners 在接口中 ChannelFutureaddListeners 在接口中 ChannelPromiseaddListeners 在接口中 Promise<java.lang.Void>public VoidChannelPromise removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureremoveListener 在接口中 ChannelFutureremoveListener 在接口中 ChannelPromiseremoveListener 在接口中 Promise<java.lang.Void>public VoidChannelPromise removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureremoveListeners 在接口中 ChannelFutureremoveListeners 在接口中 ChannelPromiseremoveListeners 在接口中 Promise<java.lang.Void>public VoidChannelPromise await() throws java.lang.InterruptedException
Futureawait 在接口中 ChannelFutureawait 在接口中 ChannelPromiseawait 在接口中 Promise<java.lang.Void>java.lang.InterruptedException - if the current thread was interruptedpublic boolean await(long timeout,
java.util.concurrent.TimeUnit unit)
Futuretrue if and only if the future was completed within
the specified time limitpublic boolean await(long timeoutMillis)
Futuretrue if and only if the future was completed within
the specified time limitpublic VoidChannelPromise awaitUninterruptibly()
FutureInterruptedException and
discards it silently.awaitUninterruptibly 在接口中 ChannelFutureawaitUninterruptibly 在接口中 ChannelPromiseawaitUninterruptibly 在接口中 Promise<java.lang.Void>public boolean awaitUninterruptibly(long timeout,
java.util.concurrent.TimeUnit unit)
FutureInterruptedException and discards it silently.true if and only if the future was completed within
the specified time limitpublic boolean awaitUninterruptibly(long timeoutMillis)
FutureInterruptedException and discards it silently.true if and only if the future was completed within
the specified time limitpublic Channel channel()
ChannelFuturechannel 在接口中 ChannelFuturechannel 在接口中 ChannelPromisepublic boolean isDone()
isDone 在接口中 java.util.concurrent.Future<java.lang.Void>public boolean isSuccess()
Futuretrue if and only if the I/O operation was completed
successfully.public boolean setUncancellable()
PromisesetUncancellable 在接口中 Promise<java.lang.Void>true if and only if successfully marked this future as uncancellable or it is already done
without being cancelled. false if this future has been cancelled already.public boolean isCancellable()
Futuretrue if and only if the operation can be cancelled via Future.cancel(boolean).public boolean isCancelled()
isCancelled 在接口中 java.util.concurrent.Future<java.lang.Void>public java.lang.Throwable cause()
Futurenull if succeeded or this future is not
completed yet.public VoidChannelPromise sync()
Futuresync 在接口中 ChannelFuturesync 在接口中 ChannelPromisesync 在接口中 Promise<java.lang.Void>public VoidChannelPromise syncUninterruptibly()
FuturesyncUninterruptibly 在接口中 ChannelFuturesyncUninterruptibly 在接口中 ChannelPromisesyncUninterruptibly 在接口中 Promise<java.lang.Void>public VoidChannelPromise setFailure(java.lang.Throwable cause)
PromiseIllegalStateException.setFailure 在接口中 ChannelPromisesetFailure 在接口中 Promise<java.lang.Void>public VoidChannelPromise setSuccess()
setSuccess 在接口中 ChannelPromisepublic boolean tryFailure(java.lang.Throwable cause)
PromisetryFailure 在接口中 Promise<java.lang.Void>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(boolean mayInterruptIfRunning)
CancellationException.cancel 在接口中 java.util.concurrent.Future<java.lang.Void>mayInterruptIfRunning - this value has no effect in this implementation.public boolean trySuccess()
trySuccess 在接口中 ChannelPromisepublic VoidChannelPromise setSuccess(java.lang.Void result)
PromiseIllegalStateException.setSuccess 在接口中 ChannelPromisesetSuccess 在接口中 Promise<java.lang.Void>public boolean trySuccess(java.lang.Void result)
PromisetrySuccess 在接口中 Promise<java.lang.Void>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 java.lang.Void getNow()
Futurenull.
As it is possible that a null value is used to mark the future as successful you also need to check
if the future is really done with Future.isDone() and not rely on the returned null value.public ChannelPromise unvoid()
ChannelPromiseunvoid 在接口中 ChannelPromisepublic boolean isVoid()
ChannelFuturetrue if this ChannelFuture is a void future and so not allow to call any of the
following methods:
isVoid 在接口中 ChannelFuture