JVMInsight Repository Groups
 


Summary
This article shows how to extend the runtime state inspection capabilities of JXInsight by creating composite repository providers. Also highlighted is a new JVMInsight repository provider implementation that inspects the JBoss AOP runtime state collecting information related to Advisors, AspectDefinitions, Pointcuts, JoinPoints, Bindings, Interceptors, etc.


Introduction

With the latest release of JXInsight we have delivered a new feature that allows the creation of composite repository providers via JVM system properties. To support a relatively high degree of flexibility and readability in the definition of repository groups there is a pattern to the required system properties.

jxinsight.server.cmdb.ext.groups=<group-1>,<group-2>
jxinsight.server.cmdb.ext.groups.<group-1>.exts=<provider-1>,<provider-2>
jxinsight.server.cmdb.ext.groups.<group-1>.name=

The first system property defines the list of repository groups that will appear alongside other primary repository providers in the management console. For each group defined in the property there should be an additional system property, jxinsight.server.cmdb.ext.groups.<group>.exts, defining the primary repository providers to be aggregated. The name of the repository appearing in the management console is by default the group identifier concatenated with the the list of extensions. To last system property allows users to override the default group name with an arbitrary string value.

Current JVMInsight Providers: jndi, hpovobs, jmgmt, jrockit, logging, rmi, cosnaming, jdbc.datasource, jdbc.activewatch, swing, jbossaop



JBoss Application Server Example
To demonstrate the repository group feature as well as highlighting the new JBoss AOP JVMInsight repository provider I created a config file, jxinsight.config, with the following contents:

jxinsight.server.cmdb.ext.groups=jbossas
jxinsight.server.cmdb.ext.groups.jbossas.exts=jmgmt,jbossaop,jdbc.activewatch
jxinsight.server.cmdb.ext.groups.jbossas.name=JBoss AS

The config file, jxinsight.config, was placed in the <jboss-install-root>/bin directory alongside the standard JBoss run.sh script. I made the following changes to the run.sh script.

# Setup system properties
JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -Xrunjdbinsight -Djxinsight.properties.config=jxinsight.config"

The system property, jxinsight.properties.config, makes it easy to specify a large number of the jxinsight system properties in a file while reducing the amount and degree of change to the script itself. The -Xrunjdbinsight VM parameter instructs the JVM to load the JXInsight native agent on JVM initialization. Please note that the jdbinsight native library (libjdbinsight.sl, libjdbinsight.so, libjdbinsight.jnilib, or jdbinsight.dll) must already be available on the Java runtime native library path.


After running up the JXInsight analysis and management console, connecting to the JBoss process, and executing the "JVM Insight" menu, the following list of repository providers is presented.



Selecting the "JBoss AS" entry and clicking OK results in runtime state information being retrieved for each of the providers specified in the group. The information is aggregated into one snapshot.




Conclusion
The composite repository mechanism is extremely important going forward in our current product release planning. For example when an serious application or runtime exception occurs in an application the user can specify a repository group to be inspected and stored within an error diagnostic snapshot. Later on operations staff can look at the snapshot related to an incident and from the detailed state information make a better informed assessment of the problem. The type of information that would prove useful in problem resolution includes runtime state information obtained from the Java 5 management and monitoring API, JXInsight trace stacks, JXInsight metrics, JDBInsight active SQL and transaction histories.


William Louth, JXInsight Product Architect


Addendum
The following screen shot shows the wealth of information collected by JVMInsight JBoss AOP repository provider.