public class DefaultRpcResponse extends CompletableFuture<Object> implements RpcResponse
RpcResponse implementation.CompletableFuture.AsynchronousCompletionTask| Constructor and Description |
|---|
DefaultRpcResponse()
Creates a new incomplete response.
|
DefaultRpcResponse(Object result)
Deprecated.
Use the factory methods in
RpcResponse. |
DefaultRpcResponse(Throwable cause)
Deprecated.
Use the factory methods in
RpcResponse. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
Throwable |
cause()
Returns the cause of the failure if this
RpcResponse completed exceptionally. |
boolean |
completeExceptionally(Throwable cause) |
Object |
get() |
Object |
get(long timeout,
TimeUnit unit) |
Object |
join()
Returns the result value if completed successfully or
throws an unchecked exception if completed exceptionally.
|
void |
obtrudeException(Throwable cause) |
String |
toString() |
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completedFuture, exceptionally, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, obtrudeValue, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfrom, getNow, isCompletedExceptionally, of, ofFailure, whenCompletecloseFuture, completionFutureisCancelled, isDoneacceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsyncpublic DefaultRpcResponse()
@Deprecated public DefaultRpcResponse(Object result)
RpcResponse.result - the result or an RPC call@Deprecated public DefaultRpcResponse(Throwable cause)
RpcResponse.cause - the cause of failurepublic final Throwable cause()
RpcResponseRpcResponse completed exceptionally.cause in interface RpcResponsenull if this RpcResponse completed successfully or did not complete yet.public boolean completeExceptionally(Throwable cause)
completeExceptionally in class CompletableFuture<Object>public void obtrudeException(Throwable cause)
obtrudeException in class CompletableFuture<Object>public boolean cancel(boolean mayInterruptIfRunning)
public Object get() throws InterruptedException, ExecutionException
get in interface Future<Object>get in class CompletableFuture<Object>InterruptedExceptionExecutionExceptionpublic Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<Object>get in class CompletableFuture<Object>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic Object join()
RpcResponsejoin in interface RpcResponsejoin in class CompletableFuture<Object>CompletableFuture.join()public String toString()
toString in class CompletableFuture<Object>Copyright © 2020 LeanCloud. All rights reserved.