|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.grizzly.utils.Futures
public class Futures
Set of utilities.
Constructor Summary | |
---|---|
Futures()
|
Method Summary | ||
---|---|---|
static
|
createReadyFuture(R result)
Create a Future , which has a preset result. |
|
static
|
createReadyFuture(Throwable error)
Create a Future , which has a preset failure. |
|
static
|
createSafeFuture()
Returns thread-safe FutureImpl implementation. |
|
static
|
createUnsafeFuture()
Returns non thread-safe FutureImpl implementation. |
|
static
|
notifyCancel(FutureImpl<R> future,
CompletionHandler completionHandler)
Complete passed FutureImpl and CompletionHandler via
the cancellation notification. |
|
static
|
notifyFailure(FutureImpl<R> future,
CompletionHandler completionHandler,
Throwable error)
Complete passed FutureImpl and CompletionHandler using
the passed error |
|
static
|
notifyResult(FutureImpl<R> future,
CompletionHandler<R> completionHandler,
R result)
Complete passed FutureImpl and CompletionHandler using
the passed result object. |
|
static
|
toAdaptedCompletionHandler(FutureImpl<A> future,
CompletionHandler<A> completionHandler,
GenericAdapter<B,A> adapter)
Creates CompletionHandler , which may serve as a bridge
for passed FutureImpl and CompletionHandler . |
|
static
|
toAdaptedCompletionHandler(FutureImpl<A> future,
GenericAdapter<B,A> adapter)
Creates CompletionHandler , which may serve as a bridge
for passed FutureImpl . |
|
static
|
toCompletionHandler(FutureImpl<R> future)
Creates CompletionHandler , which may serve as a bridge for passed
FutureImpl . |
|
static
|
toCompletionHandler(FutureImpl<R> future,
CompletionHandler<R> completionHandler)
Creates CompletionHandler , which may serve as a bridge for passed
FutureImpl and CompletionHandler objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Futures()
Method Detail |
---|
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> Future<R> createReadyFuture(R result)
Future
, which has a preset result.
result
- the result
Future
, which has a preset result.public static <R> Future<R> createReadyFuture(Throwable error)
Future
, which has a preset failure.
error
- the failure
Future
, 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 error
future
- 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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |