Class LowResourceMonitor

    • Field Detail

      • _server

        protected final Server _server
    • Constructor Detail

      • LowResourceMonitor

        public LowResourceMonitor​(@Name("server")
                                  Server server)
    • Method Detail

      • getMonitorThreads

        @ManagedAttribute("True if low available threads status is monitored")
        public boolean getMonitorThreads()
      • setMonitorThreads

        public void setMonitorThreads​(boolean monitorThreads)
        monitorThreads - If true, check connectors executors to see if they are ThreadPool instances that are low on threads.
      • getMaxConnections

        @ManagedAttribute("The maximum connections allowed for the monitored connectors before low resource handling is activated")
        public int getMaxConnections()
        Replaced by ConnectionLimit
        The maximum connections allowed for the monitored connectors before low resource handling is activated
      • setMaxConnections

        public void setMaxConnections​(int maxConnections)
        Replaced by ConnectionLimit
        maxConnections - The maximum connections before low resources state is triggered
      • getReasons

        @ManagedAttribute("The reasons the monitored connectors are low on resources")
        public java.lang.String getReasons()
      • setReasons

        protected void setReasons​(java.lang.String reasons)
      • isLowOnResources

        @ManagedAttribute("Are the monitored connectors low on resources?")
        public boolean isLowOnResources()
      • enableLowOnResources

        protected boolean enableLowOnResources​(boolean expectedValue,
                                               boolean newValue)
      • getLowResourcesReasons

        @ManagedAttribute("The reason(s) the monitored connectors are low on resources")
        public java.lang.String getLowResourcesReasons()
      • setLowResourcesReasons

        protected void setLowResourcesReasons​(java.lang.String reasons)
      • getLowResourcesStarted

        @ManagedAttribute("Get the timestamp in ms since epoch that low resources state started")
        public long getLowResourcesStarted()
      • setLowResourcesStarted

        public void setLowResourcesStarted​(long lowStarted)
      • getMonitoredConnectors

        @ManagedAttribute("The monitored connectors. If null then all server connectors are monitored")
        public java.util.Collection<Connector> getMonitoredConnectors()
      • setMonitoredConnectors

        public void setMonitoredConnectors​(java.util.Collection<Connector> monitoredConnectors)
        monitoredConnectors - The collections of Connectors that should be monitored for low resources.
      • getMonitoredOrServerConnectors

        protected Connector[] getMonitoredOrServerConnectors()
      • isAcceptingInLowResources

        @ManagedAttribute("If false, new connections are not accepted while in low resources")
        public boolean isAcceptingInLowResources()
      • setAcceptingInLowResources

        public void setAcceptingInLowResources​(boolean acceptingInLowResources)
      • setPeriod

        public void setPeriod​(int periodMS)
        periodMS - The period in ms to monitor for low resources
      • getLowResourcesIdleTimeout

        @ManagedAttribute("The idletimeout in ms to apply to all existing connections when low resources is detected")
        public int getLowResourcesIdleTimeout()
      • setLowResourcesIdleTimeout

        public void setLowResourcesIdleTimeout​(int lowResourcesIdleTimeoutMS)
        lowResourcesIdleTimeoutMS - The timeout in ms to apply to EndPoints when in the low resources state.
      • getMaxLowResourcesTime

        @ManagedAttribute("The maximum time in ms that low resources condition can persist before lowResourcesIdleTimeout is applied to new connections as well as existing connections")
        public int getMaxLowResourcesTime()
      • setMaxLowResourcesTime

        public void setMaxLowResourcesTime​(int maxLowResourcesTimeMS)
        maxLowResourcesTimeMS - The time in milliseconds that a low resource state can persist before the low resource idle timeout is reapplied to all connections
      • getMaxMemory

        @ManagedAttribute("The maximum memory (in bytes) that can be used before low resources is triggered.  Memory used is calculated as (totalMemory-freeMemory).")
        public long getMaxMemory()
      • setMaxMemory

        public void setMaxMemory​(long maxMemoryBytes)
        maxMemoryBytes - The maximum memory in bytes in use before low resources is triggered.
      • monitor

        protected void monitor()
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Starts the managed lifecycle beans in the order they were added.
        doStart in class ContainerLifeCycle
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Stops the managed lifecycle beans in the reverse order they were added.
        doStop in class ContainerLifeCycle
      • setLowResources

        protected void setLowResources()
      • clearLowResources

        protected void clearLowResources()
      • low

        protected java.lang.String low​(java.lang.String reasons,
                                       java.lang.String newReason)