Package org.apache.uima.aae.jmx.monitor
Class JmxMonitor
java.lang.Object
org.apache.uima.aae.jmx.monitor.JmxMonitor
- All Implemented Interfaces:
Runnable
Collects metrics from UIMA-AS Service MBeans at defined intervals and passes the metrics for
formatting to the registered
JmxMonitorListener-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJmxMonitorListener(JmxMonitorListener listener) Registers customJmxMonitorListenerprotected ServiceMetrics[]collectStats(boolean initial, long uptime) voiddoStop()intprotected intvoidinitialize(String remoteServerURI, long samplingInterval) Connects to a remote JMX server identified by givenremoteServerURI.booleanbooleanstatic voidvoidnotifyListeners(long uptime, ServiceMetrics[] metrics) Passes metrics to all registeredJmxMonitorListenerobjectsvoidrun()Retrieves metrics from UIMA-AS MBeans at defined interval.void
-
Field Details
-
SamplingInterval
- See Also:
-
FormatterListener
- See Also:
-
-
Constructor Details
-
JmxMonitor
public JmxMonitor()
-
-
Method Details
-
addJmxMonitorListener
Registers customJmxMonitorListener- Parameters:
listener- - listener to receive metrics for formatting
-
notifyListeners
Passes metrics to all registeredJmxMonitorListenerobjects- Parameters:
uptime- - time when the metrics were collectedmetrics- - current metrics
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose() -
getMaxServiceNameLength
public int getMaxServiceNameLength() -
initialize
Connects to a remote JMX server identified by givenremoteServerURI. Creates proxies for all UIMA AS ServicePerformance MBeans found in the JMX server registry. If UIMA AS service MBean indicates a remote service, this method connects to a remote Broker and creates a proxy to an input queue for that service.- Parameters:
remoteServerURI-samplingInterval-- Throws:
Exception
-
getServiceCount
protected int getServiceCount() -
collectStats
-
run
public void run()Retrieves metrics from UIMA-AS MBeans at defined interval. -
isRunning
public boolean isRunning() -
doStop
public void doStop() -
main
- Throws:
Exception
-