Class Request<T>

  • All Implemented Interfaces:
    java.util.concurrent.CompletionStage<T>, java.util.concurrent.Future<T>
    Direct Known Subclasses:
    GroupRequest, UnicastRequest

    public abstract class Request<T>
    extends java.util.concurrent.CompletableFuture<T>
    Abstract class for a unicast or multicast request
    Author:
    Bela Ban
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture

        java.util.concurrent.CompletableFuture.AsynchronousCompletionTask
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)  
      protected void corrDone()  
      T execute​(Message msg, boolean block_for_results)  
      abstract void memberUnreachable​(Address mbr)  
      abstract void receiveResponse​(java.lang.Object response_value, Address sender, boolean is_exception)  
      long requestId()  
      Request<T> requestId​(long req_id)  
      abstract void sendRequest​(Message req)  
      Request<T> setResponseFilter​(RspFilter filter)  
      abstract void siteUnreachable​(java.lang.String site)  
      java.lang.String toString()  
      abstract void transportClosed()  
      abstract void viewChange​(View new_view, boolean handle_previous_subgroups)  
      abstract T waitForCompletion()  
      abstract T waitForCompletion​(long timeout, java.util.concurrent.TimeUnit unit)
      Blocks until all responses have been received and returns result or throws exception
      • 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, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, 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, whenCompleteAsync
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • requestId

        public Request<T> requestId​(long req_id)
      • requestId

        public long requestId()
      • execute

        public T execute​(Message msg,
                         boolean block_for_results)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sendRequest

        public abstract void sendRequest​(Message req)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • receiveResponse

        public abstract void receiveResponse​(java.lang.Object response_value,
                                             Address sender,
                                             boolean is_exception)
      • viewChange

        public abstract void viewChange​(View new_view,
                                        boolean handle_previous_subgroups)
      • siteUnreachable

        public abstract void siteUnreachable​(java.lang.String site)
      • memberUnreachable

        public abstract void memberUnreachable​(Address mbr)
      • transportClosed

        public abstract void transportClosed()
      • waitForCompletion

        public abstract T waitForCompletion​(long timeout,
                                            java.util.concurrent.TimeUnit unit)
                                     throws java.lang.Exception
        Blocks until all responses have been received and returns result or throws exception
        Throws:
        java.lang.Exception
      • waitForCompletion

        public abstract T waitForCompletion()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<T>
        Overrides:
        cancel in class java.util.concurrent.CompletableFuture<T>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.CompletableFuture<T>
      • corrDone

        protected void corrDone()