Fuse Tooling/ JBoss AS Server Tools - JMX Merge Integration

Version 5

    Overview

     

    JBoss Tools currently supports two versions of the Java Management Extensions (JMX) Eclipse tooling -

    • Fuse Integration Perspective JMX Navigator view
    • JBoss AS Server Tools JMX Perspective

    Although both sets of tooling originate from a common base, they have diverged over time as has their functionality.  In addition, Fuse has added an additional open source tooling package - the Java Virtual Machine Monitor (jvmmonitor).  The purpose of this document is to describe in detail a phased approach at merging the two divergent implementations of JMX tooling into a single cohesive solution for both Fuse Tooling and JBoss AS Server Tools.

     

    References

     

    Design Approach

     

    The design approach is to advance in phases, maintaining a stable JBoss AS JMX code base by migrating/merging over the least disruptive bundles first, then proceeding to the more complicated plugins.  The first phase is where a complete merge is made to identify any major unknown issues and to validate that the merged functionality is build-able and can pass a minimal smoke test.

     

    Phase 1 - Full test merge

     

    The "first cut" merge was successful.  The resulting JBoss AS JMX Server Tooling is able to bring up the JMX Navigator and auto-detect JVMs running on the localhost.  The buildable module list went from 2 to 11:

     

      <modules>

        <module>org.jboss.tools.jmx.commons</module>

        <module>org.jboss.tools.jmx.core</module>

        <module>org.jboss.tools.jmx.ui</module>

        <module>org.jboss.tools.jmx.local</module>

        <module>org.jboss.tools.jmx.deployment</module>

        <module>org.jboss.tools.jmx.launcher</module>

        <module>org.jboss.tools.jmx.launcher.ui</module>

        <module>org.jboss.tools.jmx.preferences</module>

        <module>org.jboss.tools.jmx.jvmmonitor.core</module>

        <module>org.jboss.tools.jmx.jvmmonitor.tools</module>

        <module>org.jboss.tools.jmx.jvmmonitor.ui</module>

      </modules>

     

    No major blocking issues were found however the merged hybrid JMX tooling is not immediately acceptable since it intermingles core and UI functionality, adds m2e dependencies and creates new UIs.

     

    Working Functionality

     

    The JMX Navigator auto-detected JVMs running on the local host system.

    jmx3.png

     

    It was possible to manually connect to a server (com.example.main) and to invoke exposed remote management operations (i.e. add()).

     

    jmx2.png

     

    It was possible to expand remote JVMs and to dynamically track heap memory, loaded classes, active thread count and CPU usage both numerically and graphically.

     

    jmx4.png

     

    jmx1.png

    It was possible to invoke Managed Beans operations.

     

    jmx5.png

    Phase 2 - JVM Monitor merge

     

    Starting with the original JBoss AS Server Tools JMX source base, the least disruptive addition is to migrate the JVM Monitor sources.  These OSGi bundles in their original form have no Fuse or JBoss dependencies.  They will provide unused latent support at this phase - their purpose is to provide a foundation for later phase commits.

     

    The JVM Monitor consists of the following three plugins:

     

    Core (org.jboss.tools.jmx.jvmmonitor.core )

    Core support methods for connecting to host JVMs and acquiring CPU profiling data, heap memory, thread count and loaded class information from host JVMs using the JMX interface.  Information is delivered in the form of tree nodes, thread nodes and elements, heap nodes and elements and model events.  Support is also provided for monitoring MBean attributes and dynamically notifying registered listeners.

     

    Packages (5)

    • org.jboss.tools.jmx.jvmmonitor.core (19 classes)
    • org.jboss.tools.jmx.jvmmonitor.core.cpu (9 classes)
    • org.jboss.tools.jmx.jvmmonitor.core.dump (5 classes)
    • org.jboss.tools.jmx.jvmmonitor.core.mbean (6 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.core (18 classes)

     

    Tools (org.jboss.tools.jmx.jvmmonitor.tools)

    Tools for handling the handshaking with the JVMs.  Configures and validates the class and library paths, JDK root directory, etc.  Invokes monitored methods to attach/detach to the JVMs, finds a method by name, load and return agent properties, determine hot spots, etc.

     

    Packages (2)

    • org.jboss.tools.jmx.jvmmonitor.internal.tools (8 classes)
    • org.jboss.tools.jmx.jvmmonitor..tools (1 class)

     

    UI (org.jboss.tools.jmx.jvmmonitor.ui)

    Methods for displaying, both numerically and graphically (over time), CPU profiling data, heap memory, thread count and loaded class information from host JVMs.  Eclipse editor methods for dumping CPU, thread and memory information.  Dialogs for invoking MBean operations and the results.  Eclipse view extensions to establish a JVM Explorer tree, delete elements, establish new JVM connections, rename elements, start/ stop JVM monitoring and snapshot support.

     

    Packages (13)

    • org.jboss.tools.jmx.jvmmonitor.internal.ui (9 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.actions (12 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.editors (7 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties (11 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.cpu (18 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.cpu.actions (13 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.mbean (34 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.memory (19 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.overview (8 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.thread (11 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.properties.timeline (22 classes)
    • org.jboss.tools.jmx.jvmmonitor.internal.ui.views (13 classes)
    • org.jboss.tools.jmx.jvmmonitor.ui (9 classes)

     

    Note 1:

    The agent (org.jvmmonitor.agent), update (org.jvmmonitor.update) and doc (org.jvmmonitor.doc) bundles are excluded as they are not required.

    Note 2:

    The Fuse Tooling JVM Monitor is based on version 3.7.0.  The latest version is 3.8.1.  An upgrade to the JVM Monitor is required as well as a migration to JBoss AS Server Tools.

    Note 3:

    The phase 1 merge introduced some jvmmonitor dependencies to org.jboss.tools.jmx.commons.ui which need to be eliminated.

    Note 4:

    Modifications have been made to the 3.7.0 based Fuse Tooling JVM Monitor over time.  These will be merged into the new JMX JVM Monitor hybrid as it makes sense.

     

    Summary - Phase 2

     

    This commit introduces latent support only - there is not change to the JMX perspective.

     

    The candidate commit for phase 2 is based on the original 3.8.1 base, with no jmx.commons references and limited to the required bundles (core, tools, ui).   Not all of the Fuse Tooling JMX modifications are being picked up.  Those that are not picked up are concentrated on the MBean operation invocation code and MBean data display and the column configuration display in the properties view.  These work sufficiently with the current source base.  Once the JBoss AS Server Tools JMX baseline has been established then these may be reintroduced.  There are also a few UI issues that will be JIRA'd once the phase 3 check-in is complete (nothing major).

     

    Maven Reactor Build Summary:

     

         [INFO] Reactor Summary:

         [INFO]

         [INFO] jmx.all ........................................... SUCCESS [0.288s]

         [INFO] jmx.plugins ....................................... SUCCESS [0.006s]

         [INFO] org.jboss.tools.jmx.core .......................... SUCCESS [1.654s]

         [INFO] org.jboss.tools.jmx.ui ............................ SUCCESS [1.003s]

         [INFO] org.jboss.tools.jmx.jvmmonitor.core ............... SUCCESS [0.650s]

         [INFO] org.jboss.tools.jmx.jvmmonitor.tools .............. SUCCESS [0.284s]

         [INFO] org.jboss.tools.jmx.jvmmonitor.ui ................. SUCCESS [2.035s]

         [INFO] jmx.tests ......................................... SUCCESS [0.005s]

         [INFO] org.jboss.tools.jmx.core.test ..................... SUCCESS [21.485s]

         [INFO] org.jboss.tools.jmx.ui.test ....................... SUCCESS [7.141s]

         [INFO] jmx.features ...................................... SUCCESS [0.034s]

         [INFO] org.jboss.tools.jmx.feature ....................... SUCCESS [0.186s]

         [INFO] org.jboss.tools.jmx.test.feature .................. SUCCESS [0.082s]

         [INFO] ------------------------------------------------------------------------

         [INFO] BUILD SUCCESS

     

    Phase 3 - JVM Monitor Enablement and Local JVM Autodetection

     

    The phase 3 JMX integration support involves two major enhancements: auto-detection/ display of JVMs running on the local host and turning on the JVM monitor that was ported over to the AS Server Tools in phase 2.  This involves adding two new plugins to the mix.  Phase 3 also involves modifications to the existing org.jboss.tools.jmx.core and org.jboss.tools.jmx.ui plugins.

     

    New plugins:

     

    Local (org.jboss.tools.jmx.local )

    The local plugin provides the JMX Navigator view and the MBeanExplorerContentProvider method which implements the following interfaces:

    • IConnectionProviderListener
    • IStructuredContentProvider
    • ITreeContentProvider
    • RefreshableUI
    • HasViewer

    The result is a JMX Navigator view containing a "Local Processes" node in a standard Eclipse SWT tree form.  This node may be expanded to reveal all JVMs currently running on the local system.

     

    jmx6.png

     

    The local JMX Navigator supplies double-click and right-click listeners to connect/ disconnect/ refresh any JVM node (i.e. com.example.Main) and establish a JMX connection from the JvmConnectionWrapper method.

    jmx7.png

    Packages (1)

    • org.jboss.tools.jmx.ui.internal.localjmx (6 classes)

     

    Commons (org.jboss.tools.jmx.commons )

    The commons plugin provides tree and property view enhancements.  These take the form of tables, charts, labels, column configurations, property sheet pages and helper methods for retrieving root nodes and child nodes.  A variety of property descriptor enhancements are available (boolean, complex, enum, list, union, etc).  An enhanced set of images and icons are also supported.

     

    The main display components are provided through the JVM monitor plugins.  This plugin provides useful enhancements.

     

    Packages (12)

    • org.jboss.tools.jmx.commons (6 classes)
    • org.jboss.tools.jmx.commons.logging (1 class)
    • org.jboss.tools.jmx.commons.properties (8 classes)
    • org.jboss.tools.jmx.commons.tree (16 classes)
    • org.jboss.tools.jmx.commons.ui (14 classes)
    • org.jboss.tools.jmx.commons.ui.actions (11 classes)
    • org.jboss.tools.jmx.commons.ui.chart (3 classes)
    • org.jboss.tools.jmx.commons.ui.config (3 classes)
    • org.jboss.tools.jmx.commons.ui.label (14 classes)
    • org.jboss.tools.jmx.commons.ui.propsrc (5 classes)
    • org.jboss.tools.jmx.commons.ui.views (14 classes)
    • org.jboss.tools.jmx.commons.util (19 classes)

    jmx9.png

     

    Note 1:

    The package list for this plugin has been reduced from the original set defined by the Fuse Tooling IDE.

     

    JMX Core (org.jboss.tools.jmx.core )

    This existing AS Server Tools JMX plugin modifications are targeted to the following areas:

    • Extension Manager
    • Connection providers/ jobs
    • JMX activator
    • MBean attribute and feature info, MBean notification/ operation
    • tree nodes
    • schema

     

    Note 1:

    No circular dependencies between exist between core and UI.  The dependency is strictly one way (UI depends on core).

     

    JMX UI (org.jboss.tools.jmx.ui )

    This existing AS Server Tools JMX plugin modifications are targeted to the following areas:

    • Connection Wizard/ Control
    • Attribute Control
    • MBean Actions/ Interface
    • JMX/ MBean Info/ Property Source Adapters
    • Tabular/ Attribute/ Collection Control
    • Dialogs, Editors, JMX Notifications, Operations, Actions, Labels
    • UI Extensions

     

    Summary - Phase 3

     

    The candidate commit for phase 3 enables the full value of the JVM Monitor and provides a passive auto-detection of available local JVMs.  This provides users with a powerful, easy-to-use mechanism for tracking resource usage of their applications over time.  Seeing the number of loaded classes and concurrently running threads as it ties with heap usage - and then being able to dynamically run the garbage collector makes the new JMX tooling a unique perfomance tool.

     

    Maven Reactor Build Summary:

     

         [INFO] Reactor Summary:

         [INFO]

         [INFO] jmx.all ........................................... SUCCESS [0.988s]

         [INFO] jmx.plugins ....................................... SUCCESS [0.004s]

         [INFO] org.jboss.tools.jmx.commons ....................... SUCCESS [3.104s]

         [INFO] org.jboss.tools.jmx.core .......................... SUCCESS [0.421s]

         [INFO] org.jboss.tools.jmx.jvmmonitor.core ............... SUCCESS [0.632s]

         [INFO] org.jboss.tools.jmx.jvmmonitor.ui ................. SUCCESS [1.949s]

         [INFO] org.jboss.tools.jmx.ui ............................ SUCCESS [0.699s]

         [INFO] org.jboss.tools.jmx.local ......................... SUCCESS [0.254s]

         [INFO] org.jboss.tools.jmx.jvmmonitor.tools .............. SUCCESS [0.226s]

         [INFO] jmx.tests ......................................... SUCCESS [0.004s]

         [INFO] org.jboss.tools.jmx.core.test ..................... SUCCESS [8.580s]

         [INFO] org.jboss.tools.jmx.ui.test ....................... SUCCESS [6.784s]

         [INFO] jmx.features ...................................... SUCCESS [0.046s]

         [INFO] org.jboss.tools.jmx.feature ....................... SUCCESS [0.221s]

         [INFO] org.jboss.tools.jmx.test.feature .................. SUCCESS [0.065s]

         [INFO] ------------------------------------------------------------------------

         [INFO] BUILD SUCCESS

    jmx8.png

    Phase 4 ...