Class RequestTracker<ReqT extends Request<?,​ReqT,​ReplyT>,​ReplyT extends Response>

  • All Implemented Interfaces:
    ReplyHandler<ReplyT>

    public class RequestTracker<ReqT extends Request<?,​ReqT,​ReplyT>,​ReplyT extends Response>
    extends Object
    implements ReplyHandler<ReplyT>
    A class for tracking sending and received of arbitrary messages. The transport mechanism is irrelevant and is encapsulated in the Messenger request. Timeouts and Retries are handled by this mechanism and provided to the request object so they can be processed. A request is guaranteed to have one of its process method called no matter what happens. This makes it easier to write code because some kind of indication is always provided and so timing out is not needed in the client.
    Author:
    jwhite, Mathew Brozowski
    • Method Detail

      • start

        public void start()
        This method starts all the threads that are used to process the messages and also starts the messenger.
      • assertStarted

        public void assertStarted()
      • sendRequest

        public void sendRequest​(ReqT request)
                         throws Exception
        Send a tracked request via the messenger. The request is tracked for timeouts and retries. Retries are sent if the timeout processing indicates that they should be.
        Throws:
        Exception