INT-3124 Add JMX MBean Tree Inbound Adapter
Add an MBeanTreePollingMessageSource that produces a graph of simple objects representing the JMX tree (INT-3124). The DefaultMBeanObjectConverter converts MBean objects into a graph of Lists, Maps and arrays or primitives. Formatting tidy, per feedback. Feedback incorporated: split setter/attributes, more tests, inner bean constructor, logging changes. Overloaded setter methods with different parameter types are now named separately, the endpoint attributes reflect this and tests are added to reflect this. An inner bean can be supplied to provide an alternative MBeanObjectConverter. Log a warning instead of a more destructive UnsupportedOperationException where there's incomplete parsing in the DefaultMBeanObjectConverter and add a trace level for exception debugging. Minor test change and doc/reference update Added attribute filter interface as suggested. Three implementations are provided 'all', 'named only' and 'not named' actually add notnamedfield filter (doh). Polishing
This commit is contained in:
@@ -137,6 +137,39 @@
|
||||
</int-jmx:attribute-polling-channel-adapter>]]></programlisting>
|
||||
</section>
|
||||
|
||||
<section id="tree-polling-channel-adapter">
|
||||
<title>Tree Polling Channel Adapter</title>
|
||||
<para>
|
||||
The <emphasis>Tree Polling Channel Adapter</emphasis> queries the JMX MBean tree and
|
||||
sends a message with a payload that is the graph of objects that matches the query. By
|
||||
default the MBeans are mapped to primitives and simple Objects like Map, List and arrays -
|
||||
permitting simple transformation, for example, to JSON. An MBeanServer reference is also
|
||||
required, but it will automatically check for a bean named <emphasis>mbeanServer</emphasis>
|
||||
by default, just like the <emphasis>Notification-listening Channel Adapter</emphasis>
|
||||
described above. A basic configuration would be:
|
||||
</para>
|
||||
<programlisting language="xml"><![CDATA[<int-jmx:tree-polling-channel-adapter id="adapter"
|
||||
channel="channel"
|
||||
query-name="example.domain:type=*">
|
||||
<int:poller max-messages-per-poll="1" fixed-rate="5000"/>
|
||||
</int-jmx:tree-polling-channel-adapter>]]></programlisting>
|
||||
<para>
|
||||
This will include all attributes on the MBeans selected. You can filter the attributes by
|
||||
providing an <interfacename>MBeanObjectConverter</interfacename> that
|
||||
has an appropriate filter configured. The converter can be provided as a reference to
|
||||
a bean definition using the <code>converter</code> attribute, or as an
|
||||
inner <bean/> definition. A <classname>DefaultMBeanObjectConverter</classname> is
|
||||
provided which can take a <interfacename>MBeanAttributeFilter</interfacename> in
|
||||
its constructor argument.
|
||||
</para>
|
||||
<para>
|
||||
Two standard filters are provided; the <classname>NamedFieldsMBeanAttributeFilter</classname>
|
||||
allows you to specify a list of attributes to include and the
|
||||
<classname>NotNamedFieldsMBeanAttributeFilter</classname> allows you to specify a list
|
||||
of attributes to exclude. You can also implement your own filter
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="jmx-operation-invoking-channel-adapter">
|
||||
<title>Operation Invoking Channel Adapter</title>
|
||||
|
||||
|
||||
@@ -60,6 +60,17 @@
|
||||
<xref linkend="syslog"/>.
|
||||
</para>
|
||||
</section>
|
||||
<section id="3.0-jmx">
|
||||
<title>JMX Support</title>
|
||||
<para>
|
||||
A new <code><int-jmx:tree-polling-channel-adapter/></code> is provided; this
|
||||
adapter queries the JMX MBean tree and sends a message with a payload that is the
|
||||
graph of objects that matches the query. By default the MBeans are mapped to
|
||||
primitives and simple Objects like Map, List and arrays - permitting simple
|
||||
transformation, for example, to JSON
|
||||
<xref linkend="jmx"/>.
|
||||
</para>
|
||||
</section>
|
||||
<section id="3.0-tail">
|
||||
<title>'Tail' Support</title>
|
||||
<para>
|
||||
|
||||
Reference in New Issue
Block a user