Package org.redisson.misc
Class PromiseDelegator<T>
-
- org.redisson.misc.PromiseDelegator<T>
-
- Type Parameters:
T
- type
- Direct Known Subclasses:
RedissonExecutorFuture
,RedissonScheduledFuture
public class PromiseDelegator<T> extends implements RPromise<T>
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description PromiseDelegator(RPromise<T> promise)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <>
<? extends T> other, <? super T> action)
<>
<? extends T> other, <? super T> action)
<>
<? extends T> other, <? super T> action, executor)
<U> <U>
<? extends T> other, <? super T,U> fn)
<U> <U>
<? extends T> other, <? super T,U> fn)
<U> <U>
<? extends T> other, <? super T,U> fn, executor)
RPromise<T>
await()
Waits for this future to be completed.boolean
await(long timeoutMillis)
Waits for this future to be completed within the specified time limit.boolean
await(long timeout, unit)
Waits for this future to be completed within the specified time limit.RPromise<T>
awaitUninterruptibly()
Waits for this future to be completed without interruption.boolean
awaitUninterruptibly(long timeoutMillis)
Waits for this future to be completed within the specified time limit without interruption.boolean
awaitUninterruptibly(long timeout, unit)
Waits for this future to be completed within the specified time limit without interruption.boolean
cancel(boolean mayInterruptIfRunning)
cause()
Returns the cause of the failed I/O operation if the I/O operation has failed.<T>
<,? extends T> fn)
T
get()
T
get(long timeout, unit)
RPromise<T>
getInnerPromise()
T
getNow()
Return the result without blocking.<U> <U>
<? super ,? extends U> fn)
<U> <U>
<? super ,? extends U> fn)
<U> <U>
<? super ,? extends U> fn, executor)
boolean
hasListeners()
boolean
isCancelled()
boolean
isDone()
boolean
isSuccess()
Returnstrue
if and only if the I/O operation was completed successfully.T
join()
Returns the result value when complete, or throws an (unchecked) exception if completed exceptionally.void
<? super > action)
<>
<?> other, action)
<>
<?> other, action)
<>
<?> other, action, executor)
<>
<?> other, action)
<>
<?> other, action)
<>
<?> other, action, executor)
boolean
setUncancellable()
Make this future impossible to cancel.RPromise<T>
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.RPromise<T>
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.<>
<? super T> action)
<>
<? super T> action)
<>
<? super T> action, executor)
<U> <>
<? extends U> other, <? super T,? super U> action)
<U> <>
<? extends U> other, <? super T,? super U> action)
<U> <>
<? extends U> other, <? super T,? super U> action, executor)
<U> <U>
<? super T,? extends U> fn)
<U> <U>
<? super T,? extends U> fn)
<U> <U>
<? super T,? extends U> fn, executor)
<U,V>
<V><? extends U> other, <? super T,? super U,? extends V> fn)
<U,V>
<V><? extends U> other, <? super T,? super U,? extends V> fn)
<U,V>
<V><? extends U> other, <? super T,? super U,? extends V> fn, executor)
<U> <U>
<? super <U>> fn)
<U> <U>
<? super <U>> fn)
<U> <U>
<? super <U>> fn, executor)
<>
action)
<>
action)
<>
action, executor)
<T>
toCompletableFuture()
boolean
cause)
Marks this future as a failure and notifies all listeners.boolean
trySuccess(T result)
Marks this future as a success and notifies all listeners.<T>
<? super > action)
<T>
<? super > action)
<T>
<? super > action, executor)
-
-
-
Method Detail
-
join
public T join()
Description copied from interface:RFuture
Returns the result value when complete, or throws an (unchecked) exception if completed exceptionally. To better conform with the use of common functional forms, if a computation involved in the completion of this CompletableFuture threw an exception.
-
isSuccess
public boolean isSuccess()
Description copied from interface:RFuture
Returnstrue
if and only if the I/O operation was completed successfully.
-
trySuccess
public boolean trySuccess(T result)
Description copied from interface:RPromise
Marks this future as a success and notifies all listeners.- Specified by:
trySuccess
in interfaceRPromise<T>
- Parameters:
result
- object- Returns:
true
if and only if successfully marked this future as a success. Otherwisefalse
because this future is already marked as either a success or a failure.
-
cause
public cause()
Description copied from interface:RFuture
Returns the cause of the failed I/O operation if the I/O operation has failed.
-
getNow
public T getNow()
Description copied from interface:RFuture
Return the result without blocking. If the future is not done yet this will returnnull
. As it is possible that anull
value is used to mark the future as successful you also need to check if the future is really done with and not relay on the returnednull
value.
-
tryFailure
public boolean tryFailure( cause)
Description copied from interface:RPromise
Marks this future as a failure and notifies all listeners.- Specified by:
tryFailure
in interfaceRPromise<T>
- Parameters:
cause
- object- Returns:
true
if and only if successfully marked this future as a failure. Otherwisefalse
because this future is already marked as either a success or a failure.
-
await
public boolean await(long timeout, unit) throws
Description copied from interface:RFuture
Waits for this future to be completed within the specified time limit.
-
setUncancellable
public boolean setUncancellable()
Description copied from interface:RPromise
Make this future impossible to cancel.- Specified by:
setUncancellable
in interfaceRPromise<T>
- Returns:
true
if and only if successfully marked this future as uncancellable or it is already done without being cancelled.false
if this future has been cancelled already.
-
await
public boolean await(long timeoutMillis) throws
Description copied from interface:RFuture
Waits for this future to be completed within the specified time limit.
-
await
public RPromise<T> await() throws
Description copied from interface:RFuture
Waits for this future to be completed.
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
in interface
<T>
-
awaitUninterruptibly
public RPromise<T> awaitUninterruptibly()
Description copied from interface:RFuture
Waits for this future to be completed without interruption. This method catches an and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceRFuture<T>
- Specified by:
awaitUninterruptibly
in interfaceRPromise<T>
- Returns:
- Future object
-
sync
public RPromise<T> sync() throws
Description copied from interface:RFuture
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
-
syncUninterruptibly
public RPromise<T> syncUninterruptibly()
Description copied from interface:RFuture
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptibly
in interfaceRFuture<T>
- Specified by:
syncUninterruptibly
in interfaceRPromise<T>
- Returns:
- Future object
-
isCancelled
public boolean isCancelled()
- Specified by:
in interface
<T>
-
isDone
public boolean isDone()
- Specified by:
in interface
<T>
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeout, unit)
Description copied from interface:RFuture
Waits for this future to be completed within the specified time limit without interruption. This method catches an and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceRFuture<T>
- Parameters:
timeout
- - timeout valueunit
- - timeout unit value- Returns:
true
if and only if the future was completed within the specified time limit
-
awaitUninterruptibly
public boolean awaitUninterruptibly(long timeoutMillis)
Description copied from interface:RFuture
Waits for this future to be completed within the specified time limit without interruption. This method catches an and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceRFuture<T>
- Parameters:
timeoutMillis
- - timeout value- Returns:
true
if and only if the future was completed within the specified time limit
-
thenApplyAsync
public <U> <U> thenApplyAsync(<? super T,? extends U> fn)
- Specified by:
in interface
<T>
-
thenApplyAsync
public <U> <U> thenApplyAsync(<? super T,? extends U> fn, executor)
- Specified by:
in interface
<T>
-
hasListeners
public boolean hasListeners()
- Specified by:
hasListeners
in interfaceRPromise<T>
-
thenAcceptAsync
public <> thenAcceptAsync(<? super T> action, executor)
- Specified by:
in interface
<T>
-
thenRun
public <> thenRun( action)
- Specified by:
in interface
<T>
-
thenRunAsync
public <> thenRunAsync( action)
- Specified by:
in interface
<T>
-
thenRunAsync
public <> thenRunAsync( action, executor)
- Specified by:
in interface
<T>
-
thenCombine
public <U,V> <V> thenCombine(<? extends U> other, <? super T,? super U,? extends V> fn)
- Specified by:
in interface
<T>
-
thenCombineAsync
public <U,V> <V> thenCombineAsync(<? extends U> other, <? super T,? super U,? extends V> fn)
- Specified by:
in interface
<T>
-
thenCombineAsync
public <U,V> <V> thenCombineAsync(<? extends U> other, <? super T,? super U,? extends V> fn, executor)
- Specified by:
in interface
<T>
-
thenAcceptBoth
public <U> <> thenAcceptBoth(<? extends U> other, <? super T,? super U> action)
- Specified by:
in interface
<T>
-
thenAcceptBothAsync
public <U> <> thenAcceptBothAsync(<? extends U> other, <? super T,? super U> action)
- Specified by:
in interface
<T>
-
thenAcceptBothAsync
public <U> <> thenAcceptBothAsync(<? extends U> other, <? super T,? super U> action, executor)
- Specified by:
in interface
<T>
-
runAfterBoth
public <> runAfterBoth(<?> other, action)
- Specified by:
in interface
<T>
-
runAfterBothAsync
public <> runAfterBothAsync(<?> other, action)
- Specified by:
in interface
<T>
-
runAfterBothAsync
public <> runAfterBothAsync(<?> other, action, executor)
- Specified by:
in interface
<T>
-
applyToEither
public <U> <U> applyToEither(<? extends T> other, <? super T,U> fn)
- Specified by:
in interface
<T>
-
applyToEitherAsync
public <U> <U> applyToEitherAsync(<? extends T> other, <? super T,U> fn)
- Specified by:
in interface
<T>
-
applyToEitherAsync
public <U> <U> applyToEitherAsync(<? extends T> other, <? super T,U> fn, executor)
- Specified by:
in interface
<T>
-
acceptEither
public <> acceptEither(<? extends T> other, <? super T> action)
- Specified by:
in interface
<T>
-
acceptEitherAsync
public <> acceptEitherAsync(<? extends T> other, <? super T> action)
- Specified by:
in interface
<T>
-
acceptEitherAsync
public <> acceptEitherAsync(<? extends T> other, <? super T> action, executor)
- Specified by:
in interface
<T>
-
runAfterEither
public <> runAfterEither(<?> other, action)
- Specified by:
in interface
<T>
-
runAfterEitherAsync
public <> runAfterEitherAsync(<?> other, action)
- Specified by:
in interface
<T>
-
runAfterEitherAsync
public <> runAfterEitherAsync(<?> other, action, executor)
- Specified by:
in interface
<T>
-
thenCompose
public <U> <U> thenCompose(<? super <U>> fn)
- Specified by:
in interface
<T>
-
thenComposeAsync
public <U> <U> thenComposeAsync(<? super <U>> fn)
- Specified by:
in interface
<T>
-
thenComposeAsync
public <U> <U> thenComposeAsync(<? super <U>> fn, executor)
- Specified by:
in interface
<T>
-
whenComplete
public <<? super > action)
- Specified by:
in interface
<T>
-
whenCompleteAsync
public <<? super > action)
- Specified by:
in interface
<T>
-
whenCompleteAsync
public <<? super > action, executor)
- Specified by:
in interface
<T>
-
handle
public <U> <U> handle(<? super ,? extends U> fn)
- Specified by:
in interface
<T>
-
handleAsync
public <U> <U> handleAsync(<? super ,? extends U> fn)
- Specified by:
in interface
<T>
-
handleAsync
public <U> <U> handleAsync(<? super ,? extends U> fn, executor)
- Specified by:
in interface
<T>
-
onComplete
public void onComplete(<? super > action)
- Specified by:
onComplete
in interfaceRFuture<T>
-
-