Interface IResponseWrapper

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface IResponseWrapper
    extends java.lang.AutoCloseable
    IResponseWrapper is an interface that specifies the public API for objects returned by the various request-response methods of the Event Service.

    IMPORTANT
    Iff acknowledgement sequencing is being used in the EventService, then the client MUST ALWAYS ensure that releaseLock() is called on the IResponseWrapper object returned from a requestResponse() call.

    All of this assumes that there is a single receiver thread and possibly multiple client threads.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Release any threads that are blocked due to having called waitOnLock().
      Event getEvent()
      Get the wrapped Event.
      void releaseLock()
      Release any threads that are blocked due to having called waitOnLock().
    • Method Detail

      • getEvent

        Event getEvent()
        Get the wrapped Event.
        Returns:
        the wrapped Event
      • releaseLock

        void releaseLock()
        Release any threads that are blocked due to having called waitOnLock().

        This method must be called by the client thread after it has retrieved the wrapped response event.

      • close

        void close()
        Release any threads that are blocked due to having called waitOnLock().

        This method is invoked automatically on objects managed by the try-with-resources statement.

        The implementation of this method should perform the same task as releaseLock(), thus making it unnecessary to call both close() and releaseLock().

        Specified by:
        close in interface java.lang.AutoCloseable
        See Also:
        AutoCloseable.close()