| Constructor and Description |
|---|
Futures() |
| Modifier and Type | Method and Description |
|---|---|
static <R> GrizzlyFuture<R> |
createReadyFuture(R result)
Create a
Future, which has a preset result. |
static <R> GrizzlyFuture<R> |
createReadyFuture(Throwable error)
Create a
Future, which has a preset failure. |
static <R> FutureImpl<R> |
createSafeFuture()
Returns thread-safe
FutureImpl implementation. |
static <R> FutureImpl<R> |
createUnsafeFuture()
Returns non thread-safe
FutureImpl implementation. |
static <R> void |
notifyCancel(FutureImpl<R> future,
CompletionHandler completionHandler)
Complete passed
FutureImpl and CompletionHandler via
the cancellation notification. |
static <R> void |
notifyFailure(FutureImpl<R> future,
CompletionHandler completionHandler,
Throwable error)
Complete passed
FutureImpl and CompletionHandler using
the passed error |
static <R> void |
notifyResult(FutureImpl<R> future,
CompletionHandler<R> completionHandler,
R result)
Complete passed
FutureImpl and CompletionHandler using
the passed result object. |
static <A,B> CompletionHandler<B> |
toAdaptedCompletionHandler(FutureImpl<A> future,
CompletionHandler<A> completionHandler,
GenericAdapter<B,A> adapter)
|
static <A,B> CompletionHandler<B> |
toAdaptedCompletionHandler(FutureImpl<A> future,
GenericAdapter<B,A> adapter)
Creates
CompletionHandler, which may serve as a bridge
for passed FutureImpl. |
static <R> CompletionHandler<R> |
toCompletionHandler(FutureImpl<R> future)
Creates
CompletionHandler, which may serve as a bridge for passed
FutureImpl. |
static <R> CompletionHandler<R> |
toCompletionHandler(FutureImpl<R> future,
CompletionHandler<R> completionHandler)
Creates
CompletionHandler, which may serve as a bridge for passed
FutureImpl and CompletionHandler objects. |
public static <R> FutureImpl<R> createSafeFuture()
FutureImpl implementation. (Based on the JDK FutureTask).FutureImpl implementation.public static <R> FutureImpl<R> createUnsafeFuture()
FutureImpl implementation.FutureImpl implementation.public static <R> GrizzlyFuture<R> createReadyFuture(R result)
Future, which has a preset result.result - the resultFuture, which has a preset result.public static <R> GrizzlyFuture<R> createReadyFuture(Throwable error)
Future, which has a preset failure.error - the failureFuture, which has a preset failure.public static <R> void notifyResult(FutureImpl<R> future, CompletionHandler<R> completionHandler, R result)
FutureImpl and CompletionHandler using
the passed result object.future - FutureImpl to be notifiedcompletionHandler - CompletionHandler to be notifiedresult - the resultpublic static <R> void notifyFailure(FutureImpl<R> future, CompletionHandler completionHandler, Throwable error)
FutureImpl and CompletionHandler using
the passed errorfuture - FutureImpl to be notifiedcompletionHandler - CompletionHandler to be notifiederror - the error.public static <R> void notifyCancel(FutureImpl<R> future, CompletionHandler completionHandler)
FutureImpl and CompletionHandler via
the cancellation notification.future - FutureImpl to be notifiedcompletionHandler - CompletionHandler to be notifiedpublic static <R> CompletionHandler<R> toCompletionHandler(FutureImpl<R> future)
CompletionHandler, which may serve as a bridge for passed
FutureImpl. All the notifications coming to the returned
CompletionHandler will be passed to the passed FutureImpl.CompletionHandler, which may serve as a bridge for passed
FutureImpl. All the notifications coming to the returned
CompletionHandler will be passed to the passed FutureImpl.public static <R> CompletionHandler<R> toCompletionHandler(FutureImpl<R> future, CompletionHandler<R> completionHandler)
CompletionHandler, which may serve as a bridge for passed
FutureImpl and CompletionHandler objects.
All the notifications coming to the returned CompletionHandler
will be passed to the FutureImpl and CompletionHandler
passed as parameters.CompletionHandler, which may serve as a bridge for passed
FutureImpl and CompletionHandler objects.
All the notifications coming to the returned CompletionHandler
will be passed to the FutureImpl and CompletionHandler
passed as parameters.public static <A,B> CompletionHandler<B> toAdaptedCompletionHandler(FutureImpl<A> future, GenericAdapter<B,A> adapter)
CompletionHandler, which may serve as a bridge
for passed FutureImpl. All the notifications coming to the returned
CompletionHandler will be adapted using
GenericAdapter and passed to the FutureImpl.CompletionHandler, which may serve as a bridge
for passed FutureImpl. All the notifications coming to the returned
CompletionHandler will be adapted using
GenericAdapter and passed to the FutureImpl.public static <A,B> CompletionHandler<B> toAdaptedCompletionHandler(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B,A> adapter)
CompletionHandler, which may serve as a bridge
for passed FutureImpl and CompletionHandler.
All the notifications coming to the returned CompletionHandler
will be adapted using GenericAdapter and passed to the
FutureImpl and CompletionHandler.CompletionHandler, which may serve as a bridge
for passed FutureImpl and CompletionHandler.
All the notifications coming to the returned CompletionHandler
will be adapted using GenericAdapter and passed to the
FutureImpl and CompletionHandler.Copyright © 2012-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.