Class DefaultFuture
java.lang.Object
java.util.concurrent.CompletableFuture<Object>
org.apache.dubbo.remoting.exchange.support.DefaultFuture
- All Implemented Interfaces:
CompletionStage<Object>
,Future<Object>
DefaultFuture.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
boolean
cancel
(boolean mayInterruptIfRunning) static void
closeChannel
(Channel channel, long timeout) close a channel when a channel is inactive directly return the unfinished requests.static void
destroy()
static DefaultFuture
getFuture
(long id) static boolean
static DefaultFuture
newFuture
(Channel channel, Request request, int timeout, ExecutorService executor) init a DefaultFuture 1.init a DefaultFuture 2.timeout checkstatic void
static void
static void
void
setExecutor
(ExecutorService executor) Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, exceptionNow, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, 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, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Method Details
-
getExecutor
-
setExecutor
-
destroy
public static void destroy() -
newFuture
public static DefaultFuture newFuture(Channel channel, Request request, int timeout, ExecutorService executor) init a DefaultFuture 1.init a DefaultFuture 2.timeout check- Parameters:
channel
- channelrequest
- the requesttimeout
- timeout- Returns:
- a new DefaultFuture
-
getFuture
-
hasFuture
-
sent
-
closeChannel
close a channel when a channel is inactive directly return the unfinished requests.- Parameters:
channel
- channel to close
-
received
-
received
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
cancel
public void cancel() -
getRequest
-