Class JmxMonitor

java.lang.Object
org.apache.uima.aae.jmx.monitor.JmxMonitor
All Implemented Interfaces:
Runnable

public class JmxMonitor extends Object implements Runnable
Collects metrics from UIMA-AS Service MBeans at defined intervals and passes the metrics for formatting to the registered JmxMonitorListener
  • Field Details

  • Constructor Details

    • JmxMonitor

      public JmxMonitor()
  • Method Details

    • addJmxMonitorListener

      public void addJmxMonitorListener(JmxMonitorListener listener)
      Registers custom JmxMonitorListener
      Parameters:
      listener - - listener to receive metrics for formatting
    • notifyListeners

      public void notifyListeners(long uptime, ServiceMetrics[] metrics)
      Passes metrics to all registered JmxMonitorListener objects
      Parameters:
      uptime - - time when the metrics were collected
      metrics - - current metrics
    • isVerbose

      public boolean isVerbose()
    • setVerbose

      public void setVerbose()
    • getMaxServiceNameLength

      public int getMaxServiceNameLength()
    • initialize

      public void initialize(String remoteServerURI, long samplingInterval) throws Exception
      Connects to a remote JMX server identified by given remoteServerURI. 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

      protected ServiceMetrics[] collectStats(boolean initial, long uptime)
    • run

      public void run()
      Retrieves metrics from UIMA-AS MBeans at defined interval.
      Specified by:
      run in interface Runnable
    • isRunning

      public boolean isRunning()
    • doStop

      public void doStop()
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception