Class ConnectionLimit

    • Constructor Detail

      • ConnectionLimit

        public ConnectionLimit​(@Name("maxConnections")
                               int maxConnections,
                               @Name("server")
                               Server server)
      • ConnectionLimit

        public ConnectionLimit​(@Name("maxConnections")
                               int maxConnections,
                               @Name("connectors")
                               Connector... connectors)
    • Method Detail

      • getIdleTimeout

        @ManagedAttribute("The endpoint idle timeout in ms to apply when the connection limit is reached")
        public long getIdleTimeout()
        Returns:
        If >= 0, the endpoint idle timeout in ms to apply when the connection limit is reached
      • setIdleTimeout

        public void setIdleTimeout​(long idleTimeout)
        Parameters:
        idleTimeout - If >= 0 the endpoint idle timeout in ms to apply when the connection limit is reached
      • getMaxConnections

        @ManagedAttribute("The maximum number of connections allowed")
        public int getMaxConnections()
      • setMaxConnections

        public void setMaxConnections​(int max)
      • getConnections

        @ManagedAttribute("The current number of connections ")
        public int getConnections()
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to start the lifecycle
        Overrides:
        doStart in class AbstractLifeCycle
        Throws:
        AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
        java.lang.Exception - If there was a problem starting. Will cause a transition to FAILED state
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to stop the lifecycle
        Overrides:
        doStop in class AbstractLifeCycle
        Throws:
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state
      • check

        protected void check()
      • limit

        protected void limit()
      • unlimit

        protected void unlimit()
      • onAccepted

        public void onAccepted​(java.nio.channels.SelectableChannel channel)
        Description copied from interface: SelectorManager.AcceptListener
        Called after the accepted channel has been allocated an EndPoint and associated Connection, and after the onOpen notifications have been called on both endPoint and connection.
        Specified by:
        onAccepted in interface SelectorManager.AcceptListener
        Parameters:
        channel - the accepted channel