Class DefaultFuture

java.lang.Object
java.util.concurrent.CompletableFuture<Object>
org.apache.dubbo.remoting.exchange.support.DefaultFuture
All Implemented Interfaces:
CompletionStage<Object>, Future<Object>

public class DefaultFuture extends CompletableFuture<Object>
DefaultFuture.
  • Method Details

    • getExecutor

      public ExecutorService getExecutor()
    • setExecutor

      public void setExecutor(ExecutorService executor)
    • 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 - channel
      request - the request
      timeout - timeout
      Returns:
      a new DefaultFuture
    • getFuture

      public static DefaultFuture getFuture(long id)
    • hasFuture

      public static boolean hasFuture(Channel channel)
    • sent

      public static void sent(Channel channel, Request request)
    • closeChannel

      public static void closeChannel(Channel channel, long timeout)
      close a channel when a channel is inactive directly return the unfinished requests.
      Parameters:
      channel - channel to close
    • received

      public static void received(Channel channel, Response response)
    • received

      public static void received(Channel channel, Response response, boolean timeout)
    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      Specified by:
      cancel in interface Future<Object>
      Overrides:
      cancel in class CompletableFuture<Object>
    • cancel

      public void cancel()
    • getRequest

      public Request getRequest()