Top Description Constructors Methods
io.vertx.core.impl.future

public final Class PromiseImpl<T>

extends FutureImpl<T>
implements PromiseInternal<T>, Listener<T>
Class Inheritance
All Implemented Interfaces
io.vertx.core.impl.future.Listener, io.vertx.core.impl.future.PromiseInternal, io.vertx.core.impl.future.FutureInternal, io.vertx.core.Future, io.vertx.core.AsyncResult, io.netty.util.concurrent.FutureListener, io.netty.util.concurrent.GenericFutureListener, java.util.EventListener, io.vertx.core.Promise, io.vertx.core.Handler
Imports
io.vertx.core.AsyncResult, .Future, io.vertx.core.impl.ContextInternal

Promise implementation.
Author
Julien Viet

Constructor Summary

AccessConstructor and Description
public
PromiseImpl()

Create a promise that hasn't completed yet

public
PromiseImpl(ContextInternal context)

Create a promise that hasn't completed yet

Method Summary

Modifier and TypeMethod and Description
public Future<T>
public void
handle(AsyncResult<T>
the async result to handle
ar
)

Overrides default io.vertx.core.Promise.handle.

Succeed or fail this promise with the AsyncResult event.

public void
onFailure(Throwable
the failure
failure
)

Implements io.vertx.core.impl.future.Listener.onFailure.

Signal the failure

public void
onSuccess(T
the value
value
)

Implements io.vertx.core.impl.future.Listener.onSuccess.

Signal the success.

public void
operationComplete(Future<T>
the source Future which called this callback
future
)

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.

Inherited from io.vertx.core.impl.future.FutureImpl:
addListenercausefailedformatValueisCompleteonCompleteonCompleteonFailureonSuccessremoveListenerresultsucceededtoStringtryCompletetryFail

Constructor Detail

PromiseImplback to summary
public PromiseImpl()

Create a promise that hasn't completed yet

PromiseImplback to summary
public PromiseImpl(ContextInternal context)

Create a promise that hasn't completed yet

Method Detail

futureback to summary
public Future<T> future()

Implements io.vertx.core.Promise.future.

Returns:Future<T>

Doc from io.vertx.core.Promise.future.

the Future associated with this promise, it can be used to be aware of the promise completion

Annotations
@Override
handleback to summary
public void handle(AsyncResult<T> ar)

Overrides default io.vertx.core.Promise.handle.

Doc from io.vertx.core.Promise.handle.

Succeed or fail this promise with the AsyncResult event.

Parameters
ar:AsyncResult<T>

the async result to handle

onFailureback to summary
public void onFailure(Throwable failure)

Implements io.vertx.core.impl.future.Listener.onFailure.

Doc from io.vertx.core.impl.future.Listener.onFailure.

Signal the failure

Parameters
failure:Throwable

the failure

Annotations
@Override
onSuccessback to summary
public void onSuccess(T value)

Implements io.vertx.core.impl.future.Listener.onSuccess.

Doc from io.vertx.core.impl.future.Listener.onSuccess.

Signal the success.

Parameters
value:T

the value

Annotations
@Override
operationCompleteback to summary
public void operationComplete(Future<T> future)

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Doc from io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.

Parameters
future:Future<T>

the source Future which called this callback

Annotations
@Override