Class MaxConnectionIdleManager


  • public final class MaxConnectionIdleManager
    extends java.lang.Object
    Monitors connection idle time; shutdowns the connection if the max connection idle is reached.
    • Field Detail

      • maxConnectionIdleInNanos

        private final long maxConnectionIdleInNanos
      • shutdownFuture

        @CheckForNull
        private java.util.concurrent.ScheduledFuture<?> shutdownFuture
      • shutdownTask

        private java.lang.Runnable shutdownTask
      • scheduler

        private java.util.concurrent.ScheduledExecutorService scheduler
      • nextIdleMonitorTime

        private long nextIdleMonitorTime
      • shutdownDelayed

        private boolean shutdownDelayed
      • isActive

        private boolean isActive
    • Constructor Detail

      • MaxConnectionIdleManager

        public MaxConnectionIdleManager​(long maxConnectionIdleInNanos)
    • Method Detail

      • start

        public void start​(java.lang.Runnable closeJob,
                          java.util.concurrent.ScheduledExecutorService scheduler)
        Start the initial scheduled shutdown given the transport status reaches max connection idle.
        Parameters:
        closeJob - Closes the connection by sending GO_AWAY with status code NO_ERROR and ASCII debug data max_idle and then doing the graceful connection termination.
      • onTransportActive

        public void onTransportActive()
        There are outstanding RPCs on the transport.
      • onTransportIdle

        public void onTransportIdle()
        There are no outstanding RPCs on the transport.
      • onTransportTermination

        public void onTransportTermination()
        Transport is being terminated.