Package com.linecorp.armeria.common
Class CompletableRpcResponse
java.lang.Object
java.util.concurrent.CompletableFuture<T>
com.linecorp.armeria.common.util.EventLoopCheckingFuture<Object>
com.linecorp.armeria.common.CompletableRpcResponse
- All Implemented Interfaces:
Response
,RpcResponse
,CompletionStage<Object>
,Future<Object>
public final class CompletableRpcResponse
extends EventLoopCheckingFuture<Object>
implements RpcResponse
An
RpcResponse
implementation which is initially incomplete and can be completed later.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) cause()
Returns the cause of the failure if thisRpcResponse
completed exceptionally.boolean
completeExceptionally
(Throwable cause) void
obtrudeException
(Throwable cause) toString()
Methods inherited from class com.linecorp.armeria.common.util.EventLoopCheckingFuture
completedFuture, exceptionallyCompletedFuture, get, get, join
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completeAsync, completeAsync, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, exceptionNow, failedFuture, failedStage, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, minimalCompletionStage, newIncompleteFuture, obtrudeValue, orTimeout, resultNow, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, state, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, 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, whenCompleteAsync
Methods inherited from interface java.util.concurrent.Future
exceptionNow, get, get, isCancelled, isDone, resultNow, state
Methods inherited from interface com.linecorp.armeria.common.RpcResponse
getNow, isCompletedExceptionally, join, whenComplete
-
Constructor Details
-
CompletableRpcResponse
public CompletableRpcResponse()
-
-
Method Details
-
cause
Description copied from interface:RpcResponse
Returns the cause of the failure if thisRpcResponse
completed exceptionally.- Specified by:
cause
in interfaceRpcResponse
- Returns:
- the cause, or
null
if thisRpcResponse
completed successfully or did not complete yet.
-
completeExceptionally
- Overrides:
completeExceptionally
in classCompletableFuture<Object>
-
obtrudeException
- Overrides:
obtrudeException
in classCompletableFuture<Object>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
toString
- Overrides:
toString
in classCompletableFuture<Object>
-