Class CollectedInfo


  • public class CollectedInfo
    extends java.lang.Object
    Listener to provide information to mod_heartbeat.c. Collects connector thread pool information via JMX to report ready and busy thread counts.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.management.MBeanServer mBeanServer
      The MBean server used to collect information.
      protected javax.management.ObjectName objName
      The object name of the thread pool MBean.
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectedInfo​(java.lang.String host, int port)
      Creates a new CollectedInfo instance and initializes it with the specified host and port.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init​(java.lang.String host, int port)
      Initializes the collected info by looking up the thread pool MBean for the given host and port.
      void refresh()
      Refreshes the ready and busy thread counts from the thread pool MBean.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mBeanServer

        protected javax.management.MBeanServer mBeanServer
        The MBean server used to collect information.
      • objName

        protected javax.management.ObjectName objName
        The object name of the thread pool MBean.
    • Constructor Detail

      • CollectedInfo

        public CollectedInfo​(java.lang.String host,
                             int port)
                      throws java.lang.Exception
        Creates a new CollectedInfo instance and initializes it with the specified host and port.
        Parameters:
        host - the host
        port - the port
        Throws:
        java.lang.Exception - if initialization fails
    • Method Detail

      • init

        public void init​(java.lang.String host,
                         int port)
                  throws java.lang.Exception
        Initializes the collected info by looking up the thread pool MBean for the given host and port.
        Parameters:
        host - the host (may be null to match any host)
        port - the port (0 to match any port)
        Throws:
        java.lang.Exception - if no matching connector is found
      • refresh

        public void refresh()
                     throws java.lang.Exception
        Refreshes the ready and busy thread counts from the thread pool MBean.
        Throws:
        java.lang.Exception - if not initialized or MBean access fails