Top Fields Constructors Methods
io.netty5.util.concurrent

pack-priv final Class RunnableFutureAdapter<V>

extends Object
implements RunnableFuture<V>
Class Inheritance
All Implemented Interfaces
io.netty5.util.concurrent.RunnableFuture, io.netty5.util.concurrent.Future, io.netty5.util.concurrent.AsynchronousResult, java.lang.Runnable
Imports
io.netty5.util.internal.StringUtil, java.util.concurrent.Callable

Field Summary

Modifier and TypeField and Description
private final Future<V>
private final Promise<V>
private final Callable<V>

Constructor Summary

AccessConstructor and Description
pack-priv
RunnableFutureAdapter(Promise<V> promise, Callable<V> task)

Method Summary

Modifier and TypeMethod and Description
public RunnableFuture<V>
addListener(FutureListener<? super V>
The listener to be called when this future completes. The listener will be passed this future as an argument.
listener
)

Implements io.netty5.util.concurrent.RunnableFuture.addListener.

Adds the specified listener to this future.
public <C> RunnableFuture<V>
addListener(C
The context object that will be passed to the listener when this future completes.
context
,
FutureContextListener<? super C, ? super V>
The listener to be called when this future completes. The listener will be passed the given context, and this future.
listener
)

Implements io.netty5.util.concurrent.RunnableFuture.addListener.

Adds the specified listener to this future.
public FutureCompletionStage<V>
asStage()

Implements io.netty5.util.concurrent.Future.asStage.

Returns a FutureCompletionStage that reflects the state of this Future and so will receive all updates as well.
public boolean
cancel()

Implements io.netty5.util.concurrent.AsynchronousResult.cancel.

Cancel this asynchronous operation, unless it has already been completed or is not cancellable.
public Throwable
cause()

Implements io.netty5.util.concurrent.AsynchronousResult.cause.

Returns the cause of the failed operation if the operation has failed.
public EventExecutor
public V
getNow()

Implements io.netty5.util.concurrent.AsynchronousResult.getNow.

Return the successful result of this asynchronous operation, if any.
public boolean
isCancellable()

Implements io.netty5.util.concurrent.AsynchronousResult.isCancellable.

Returns true if and only if the operation can be cancelled via cancel().
public boolean
isCancelled()

Implements io.netty5.util.concurrent.AsynchronousResult.isCancelled.

Return true if this operation has been cancelled.
public boolean
isDone()

Implements io.netty5.util.concurrent.AsynchronousResult.isDone.

Return true if this operation has been completed either successfully, unsuccessfully, or through cancellation.
public boolean
isFailed()

Implements io.netty5.util.concurrent.AsynchronousResult.isFailed.

Returns true if and only if the operation was completed and failed.
public boolean
isSuccess()

Implements io.netty5.util.concurrent.AsynchronousResult.isSuccess.

Returns true if and only if the operation was completed successfully.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

futureback to summary
private final Future<V> future
promiseback to summary
private final Promise<V> promise
taskback to summary
private final Callable<V> task

Constructor Detail

RunnableFutureAdapterback to summary
pack-priv RunnableFutureAdapter(Promise<V> promise, Callable<V> task)

Method Detail

addListenerback to summary
public RunnableFuture<V> addListener(FutureListener<? super V> listener)

Implements io.netty5.util.concurrent.RunnableFuture.addListener.

Doc from io.netty5.util.concurrent.Future.addListener.

Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.

Parameters
listener:FutureListener<? super V>

The listener to be called when this future completes. The listener will be passed this future as an argument.

Returns:RunnableFuture<V>

this future object.

Annotations
@Override
addListenerback to summary
public <C> RunnableFuture<V> addListener(C context, FutureContextListener<? super C, ? super V> listener)

Implements io.netty5.util.concurrent.RunnableFuture.addListener.

Doc from io.netty5.util.concurrent.Future.addListener.

Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.

Parameters
context:C

The context object that will be passed to the listener when this future completes.

listener:FutureContextListener<? super C, ? super V>

The listener to be called when this future completes. The listener will be passed the given context, and this future.

Returns:RunnableFuture<V>

this future object.

Annotations
@Override
asStageback to summary
public FutureCompletionStage<V> asStage()

Implements io.netty5.util.concurrent.Future.asStage.

Doc from io.netty5.util.concurrent.Future.asStage.

Returns a FutureCompletionStage that reflects the state of this Future and so will receive all updates as well.

The returned FutureCompletionStage also implements the JDK java.util.concurrent.Future, and has blocking methods not found on the Netty Future interface, for awaiting the completion.

Annotations
@Override
cancelback to summary
public boolean cancel()

Implements io.netty5.util.concurrent.AsynchronousResult.cancel.

Doc from io.netty5.util.concurrent.AsynchronousResult.cancel.

Cancel this asynchronous operation, unless it has already been completed or is not cancellable.

A cancelled operation is considered to be done and failed.

If the cancellation was successful, the result of this operation will be that it has failed with a CancellationException.

Cancellation will not cause any threads working on the operation to be interrupted.

Returns:boolean

true if the operation was cancelled by this call, otherwise false.

Annotations
@Override
causeback to summary
public Throwable cause()

Implements io.netty5.util.concurrent.AsynchronousResult.cause.

Doc from io.netty5.util.concurrent.AsynchronousResult.cause.

Returns the cause of the failed operation if the operation has failed.

Returns:Throwable

The cause of the failure, if any. Otherwise null if succeeded.

Annotations
@Override
executorback to summary
public EventExecutor executor()

Implements io.netty5.util.concurrent.AsynchronousResult.executor.

Doc from io.netty5.util.concurrent.AsynchronousResult.executor.

Returns the EventExecutor that is tied to this Promise or Future.

Annotations
@Override
getNowback to summary
public V getNow()

Implements io.netty5.util.concurrent.AsynchronousResult.getNow.

Doc from io.netty5.util.concurrent.AsynchronousResult.getNow.

Return the successful result of this asynchronous operation, if any. If the operation has not yet been completed, then this will throw IllegalStateException. If the operation has been cancelled or failed with an exception, then this returns null. Note that asynchronous operations can also be completed successfully with a null result.

Returns:V

the result of this operation, if completed successfully.

Annotations
@Override
isCancellableback to summary
public boolean isCancellable()

Implements io.netty5.util.concurrent.AsynchronousResult.isCancellable.

Doc from io.netty5.util.concurrent.AsynchronousResult.isCancellable.

Returns true if and only if the operation can be cancelled via cancel(). Note that this is inherently racy, as the operation could be made uncancellable at any time.

Returns:boolean

true if this operation can be cancelled.

Annotations
@Override
isCancelledback to summary
public boolean isCancelled()

Implements io.netty5.util.concurrent.AsynchronousResult.isCancelled.

Doc from io.netty5.util.concurrent.AsynchronousResult.isCancelled.

Return true if this operation has been cancelled.

Returns:boolean

true if this operation has been cancelled, otherwise false.

Annotations
@Override
isDoneback to summary
public boolean isDone()

Implements io.netty5.util.concurrent.AsynchronousResult.isDone.

Doc from io.netty5.util.concurrent.AsynchronousResult.isDone.

Return true if this operation has been completed either successfully, unsuccessfully, or through cancellation.

Returns:boolean

true if this operation has completed, otherwise false.

Annotations
@Override
isFailedback to summary
public boolean isFailed()

Implements io.netty5.util.concurrent.AsynchronousResult.isFailed.

Doc from io.netty5.util.concurrent.AsynchronousResult.isFailed.

Returns true if and only if the operation was completed and failed.

Annotations
@Override
isSuccessback to summary
public boolean isSuccess()

Implements io.netty5.util.concurrent.AsynchronousResult.isSuccess.

Doc from io.netty5.util.concurrent.AsynchronousResult.isSuccess.

Returns true if and only if the operation was completed successfully.

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override