Class BlockingInvocation


  • public class BlockingInvocation
    extends Invocation
    A blocking invocation. This class may be used as-is or subclassed for additional functionality.
    Author:
    David M. Lloyd
    • Constructor Detail

      • BlockingInvocation

        public BlockingInvocation​(int index)
        Construct a new instance.
        Parameters:
        index - the invocation index
    • Method Detail

      • handleResponse

        public void handleResponse​(int parameter,
                                   MessageInputStream inputStream)
        Description copied from class: Invocation
        Handle a response on this invocation. The response may be final or it may be an update. Long tasks should be executed in a worker thread. This method must guarantee that inputStream is closed.
        Specified by:
        handleResponse in class Invocation
        Parameters:
        parameter - the numeric parameter passed in to the tracker
        inputStream - the body of the message
      • handleClosed

        public void handleClosed()
        Description copied from class: Invocation
        Handle closure of the channel.
        Specified by:
        handleClosed in class Invocation
      • handleException

        public void handleException​(IOException exception)
        Description copied from class: Invocation
        Handle a failure that occurred on the channel while the invocation was outstanding.
        Specified by:
        handleException in class Invocation
        Parameters:
        exception - the exception that was thrown
      • cancel

        public void cancel()
        Cancel the invocation, causing all future responses to be closed without being read. This method should only be called from the waiting thread (for example, in response to thread interruption).