Interface ManagementChannelShutdownHandle

  • All Known Implementing Classes:
    AbstractMessageHandler, ManagementChannelHandler

    public interface ManagementChannelShutdownHandle
    A handle to a processor of management requests which can be used to coordinate a controlled shutdown of a processor that allows active operations to complete before shutting down. TODO this should be redone to use callbacks to signal when all operations are completed
    Author:
    Emanuel Muckenhuber
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean awaitCompletion​(long timeout, TimeUnit unit)
      Await the completion of all currently active operations.
      void shutdown()
      Don't allow new operations, but still allow requests for existing ones.
      void shutdownNow()
      This will attempt to cancel all active operations, without waiting for their completion.
    • Method Detail

      • shutdown

        void shutdown()
        Don't allow new operations, but still allow requests for existing ones.

        This method does not wait for previously submitted operations to be completed. Use awaitCompletion to do that.

      • shutdownNow

        void shutdownNow()
        This will attempt to cancel all active operations, without waiting for their completion.
      • awaitCompletion

        boolean awaitCompletion​(long timeout,
                                TimeUnit unit)
                         throws InterruptedException
        Await the completion of all currently active operations.
        Parameters:
        timeout - the timeout
        unit - the time unit
        Returns:
        false if the timeout was reached and there were still active operations
        Throws:
        InterruptedException