Package org.apache.catalina.ha.backend
Class CollectedInfo
- java.lang.Object
-
- org.apache.catalina.ha.backend.CollectedInfo
-
public class CollectedInfo extends java.lang.ObjectListener 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.MBeanServermBeanServerThe MBean server used to collect information.protected javax.management.ObjectNameobjNameThe 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 voidinit(java.lang.String host, int port)Initializes the collected info by looking up the thread pool MBean for the given host and port.voidrefresh()Refreshes the ready and busy thread counts from the thread pool MBean.
-
-
-
Constructor Detail
-
CollectedInfo
public CollectedInfo(java.lang.String host, int port) throws java.lang.ExceptionCreates a new CollectedInfo instance and initializes it with the specified host and port.- Parameters:
host- the hostport- the port- Throws:
java.lang.Exception- if initialization fails
-
-
Method Detail
-
init
public void init(java.lang.String host, int port) throws java.lang.ExceptionInitializes 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.ExceptionRefreshes the ready and busy thread counts from the thread pool MBean.- Throws:
java.lang.Exception- if not initialized or MBean access fails
-
-