Uses of Interface
org.forgerock.util.promise.Promise
Packages that use Promise
Package
Description
Provides common interfaces and classes.
An implementation of the
Promise
API in Java.-
Uses of Promise in org.forgerock.util
Methods in org.forgerock.util that return Promise -
Uses of Promise in org.forgerock.util.promise
Classes in org.forgerock.util.promise that implement PromiseModifier and TypeClassDescriptionclass
PromiseImpl<V,
E extends Exception> An implementation ofPromise
which can be used as is, or as the basis for more complex asynchronous behavior.Methods in org.forgerock.util.promise that return PromiseModifier and TypeMethodDescriptionPromises.newExceptionPromise
(E exception) Returns aPromise
representing an asynchronous task which has already failed with the provided exception.Promises.newResultPromise
(V result) Returns aPromise
representing an asynchronous task which has already succeeded with the provided result.Promises.newRuntimeExceptionPromise
(RuntimeException exception) Returns aPromise
representing an asynchronous task which has already failed with the provided runtime exception.Submits the provided function for execution once thisPromise
has completed with a result, and returns a newPromise
representing the outcome of the function.Submits the provided functions for execution once thisPromise
has completed (with a result or an exception), and returns a newPromise
representing the outcome of the invoked function.Promise.then
(Function<? super V, VOUT, EOUT> onResult, Function<? super E, VOUT, EOUT> onException, Function<? super RuntimeException, VOUT, EOUT> onRuntimeException) Submits the provided functions for execution once thisPromise
has completed (with a result or an exception or aRuntimeException
), and returns a newPromise
representing the outcome of the invoked function.PromiseImpl.then
(Function<? super V, VOUT, EOUT> onResult, Function<? super E, VOUT, EOUT> onException, Function<? super RuntimeException, VOUT, EOUT> onRuntimeException) Promise.thenAlways
(Runnable onResultOrException) Submits the provided runnable for execution once thisPromise
has completed, and regardless of whether it has a result or an exception.PromiseImpl.thenAlways
(Runnable always) Promise.thenAsync
(AsyncFunction<? super V, VOUT, E> onResult) Submits the provided asynchronous function for execution once thisPromise
has completed with a result, and returns a newPromise
representing the outcome of the function.Promise.thenAsync
(AsyncFunction<? super V, VOUT, EOUT> onResult, AsyncFunction<? super E, VOUT, EOUT> onException) Submits the provided asynchronous functions for execution once thisPromise
has completed, and returns a newPromise
representing the outcome of the invoked function.Promise.thenAsync
(AsyncFunction<? super V, VOUT, EOUT> onResult, AsyncFunction<? super E, VOUT, EOUT> onException, AsyncFunction<? super RuntimeException, VOUT, EOUT> onRuntimeException) Submits the provided asynchronous functions for execution once thisPromise
has completed, and returns a newPromise
representing the outcome of the invoked function.PromiseImpl.thenAsync
(AsyncFunction<? super V, VOUT, E> onResult) PromiseImpl.thenAsync
(AsyncFunction<? super V, VOUT, EOUT> onResult, AsyncFunction<? super E, VOUT, EOUT> onException) PromiseImpl.thenAsync
(AsyncFunction<? super V, VOUT, EOUT> onResult, AsyncFunction<? super E, VOUT, EOUT> onException, AsyncFunction<? super RuntimeException, VOUT, EOUT> onRuntimeException) Submits the provided function for execution once thisPromise
has not completed with a result (has completed with an exception), and returns a newPromise
representing the outcome of the function.Promise.thenCatchAsync
(AsyncFunction<? super E, V, EOUT> onException) Submits the provided asynchronous function for execution once thisPromise
has completed with an exception, and returns a newPromise
representing the outcome of the function.PromiseImpl.thenCatchAsync
(AsyncFunction<? super E, V, EOUT> onException) Promise.thenCatchRuntimeException
(Function<? super RuntimeException, V, E> onRuntimeException) Submits the provided function for execution once thisPromise
has not completed with a result nor with an exception but with aRuntimeException
, and returns a newPromise
representing the outcome of the function.PromiseImpl.thenCatchRuntimeException
(Function<? super RuntimeException, V, E> onRuntimeException) Promise.thenCatchRuntimeExceptionAsync
(AsyncFunction<? super RuntimeException, V, E> onRuntimeException) Submits the provided asynchronous function for execution once thisPromise
has completed with aRuntimeException
, and returns a newPromise
representing the outcome of the function.PromiseImpl.thenCatchRuntimeExceptionAsync
(AsyncFunction<? super RuntimeException, V, E> onRuntimeException) Promise.thenFinally
(Runnable onResultOrException) Submits the provided runnable for execution once thisPromise
has completed, and regardless of whether of its outcome.PromiseImpl.thenFinally
(Runnable onFinally) Promise.thenOnException
(ExceptionHandler<? super E> onException) Registers the provided completion handler for notification if thisPromise
cannot be completed due to an exception.PromiseImpl.thenOnException
(ExceptionHandler<? super E> onException) Promise.thenOnResult
(ResultHandler<? super V> onResult) Registers the provided completion handler for notification once thisPromise
has completed with a result.PromiseImpl.thenOnResult
(ResultHandler<? super V> onResult) Promise.thenOnResultOrException
(Runnable onResultOrException) Submits the provided runnable for execution once thisPromise
has completed, and regardless of whether it has a result or an exception.Promise.thenOnResultOrException
(ResultHandler<? super V> onResult, ExceptionHandler<? super E> onException) Registers the provided completion handlers for notification once thisPromise
has completed (with a result or an exception).PromiseImpl.thenOnResultOrException
(Runnable onResultOrException) PromiseImpl.thenOnResultOrException
(ResultHandler<? super V> onResult, ExceptionHandler<? super E> onException) Promise.thenOnRuntimeException
(RuntimeExceptionHandler onRuntimeException) Registers the provided completion handler for notification if thisPromise
cannot be completed due to an runtime exception.PromiseImpl.thenOnRuntimeException
(RuntimeExceptionHandler onRuntimeException) Returns aPromise
which will be completed once all of the provided promises have succeeded, or as soon as one of them fails.Returns aPromise
which will be completed once all of the provided promises have succeeded, or as soon as one of them fails.Methods in org.forgerock.util.promise with parameters of type PromiseModifier and TypeMethodDescriptionReturns aPromise
which will be completed once all of the provided promises have succeeded, or as soon as one of them fails.Method parameters in org.forgerock.util.promise with type arguments of type Promise