Package com.zeroc.Ice

Class InvocationFuture<T>

java.lang.Object
java.util.concurrent.CompletableFuture<T>
com.zeroc.Ice.InvocationFuture<T>
All Implemented Interfaces:
CompletionStage<T>, Future<T>

public abstract class InvocationFuture<T> extends CompletableFuture<T>
An instance of an InvocationFuture subclass is the return value of an asynchronous invocation. With this object, an application can obtain several attributes of the invocation.
  • Constructor Details

    • InvocationFuture

      public InvocationFuture()
  • Method Details

    • cancel

      public abstract boolean cancel()
      If not completed, cancels the request. This is a local operation, it won't cancel the request on the server side. Calling cancel prevents a queued request from being sent or ignores a reply if the request has already been sent.
      Returns:
      True if this task is now cancelled.
    • getCommunicator

      public abstract Communicator getCommunicator()
      Returns the communicator that sent the invocation.
      Returns:
      The communicator.
    • getConnection

      public abstract Connection getConnection()
      Returns the connection that was used to start the invocation, or nil if this future was not obtained via an asynchronous connection invocation (such as flushBatchRequestsAsync).
      Returns:
      The connection.
    • getProxy

      public abstract ObjectPrx getProxy()
      Returns the proxy that was used to start the asynchronous invocation, or nil if this object was not obtained via an asynchronous proxy invocation.
      Returns:
      The proxy.
    • getOperation

      public abstract String getOperation()
      Returns the name of the operation.
      Returns:
      The operation name.
    • waitForCompleted

      public abstract void waitForCompleted()
      Blocks the caller until the result of the invocation is available.
    • isSent

      public abstract boolean isSent()
      When you start an asynchronous invocation, the Ice run time attempts to write the corresponding request to the client-side transport. If the transport cannot accept the request, the Ice run time queues the request for later transmission. This method returns true if, at the time it is called, the request has been written to the local transport (whether it was initially queued or not). Otherwise, if the request is still queued, this method returns false.
      Returns:
      True if the request has been sent, or false if the request is queued.
    • waitForSent

      public abstract void waitForSent()
      Blocks the caller until the request has been written to the client-side transport.
    • sentSynchronously

      public abstract boolean sentSynchronously()
      Returns true if a request was written to the client-side transport without first being queued. If the request was initially queued, this method returns false (independent of whether the request is still in the queue or has since been written to the client-side transport).
      Returns:
      True if the request was sent without being queued, or false otherwise.
    • whenSent

      public abstract CompletableFuture<Boolean> whenSent(BiConsumer<Boolean,? super Throwable> action)
      Returns a future that completes when the entire request message has been accepted by the transport and executes the given action. The boolean value indicates whether the message was sent synchronously.
      Parameters:
      action - Executed when the future is completed successfully or exceptionally.
      Returns:
      A future that completes when the message has been handed off to the transport.
    • whenSentAsync

      public abstract CompletableFuture<Boolean> whenSentAsync(BiConsumer<Boolean,? super Throwable> action)
      Returns a future that completes when the entire request message has been accepted by the transport and executes the given action using the default executor. The boolean value indicates whether the message was sent synchronously.
      Parameters:
      action - Executed when the future is completed successfully or exceptionally.
      Returns:
      A future that completes when the message has been handed off to the transport.
    • whenSentAsync

      public abstract CompletableFuture<Boolean> whenSentAsync(BiConsumer<Boolean,? super Throwable> action, Executor executor)
      Returns a future that completes when the entire request message has been accepted by the transport and executes the given action using the executor. The boolean value indicates whether the message was sent synchronously.
      Parameters:
      action - Executed when the future is completed successfully or exceptionally.
      executor - The executor to use for asynchronous execution.
      Returns:
      A future that completes when the message has been handed off to the transport.