<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: &#9873; JMX Scripts using JRuby</title>
	<atom:link href="http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/</link>
	<description>Thoughts about Java, Web and Software Development</description>
	<lastBuildDate>Wed, 11 May 2011 05:38:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: GSIY &#8230; Ruby-Rails Portal</title>
		<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/comment-page-1/#comment-51089</link>
		<dc:creator>GSIY &#8230; Ruby-Rails Portal</dc:creator>
		<pubDate>Wed, 05 Sep 2007 16:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://jmesnil.net/weblog/2007/03/13/jmx-scripts-using-jruby/#comment-51089</guid>
		<description>&lt;p&gt;[...]  of JMX on JRuby came up recently and I decided to play around. I found a great starter on Jeff Mesnil&#8217;s blog, but I decided I hated the syntax. Ruby has spoiled me. Ac [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...]  of JMX on JRuby came up recently and I decided to play around. I found a great starter on Jeff Mesnil&#8217;s blog, but I decided I hated the syntax. Ruby has spoiled me. Ac [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Mesnil&#8217;s Weblog  &#187; Blog Archive   &#187; JMX Scripts using JRuby</title>
		<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/comment-page-1/#comment-42929</link>
		<dc:creator>Jeff Mesnil&#8217;s Weblog  &#187; Blog Archive   &#187; JMX Scripts using JRuby</dc:creator>
		<pubDate>Mon, 16 Jul 2007 09:45:56 +0000</pubDate>
		<guid isPermaLink="false">http://jmesnil.net/weblog/2007/03/13/jmx-scripts-using-jruby/#comment-42929</guid>
		<description>&lt;p&gt;[...] :newPlatformMXBeanProxy instead of MBeanServerInvocationHandler::newProxyInstance based on Daniel comment]  I needed to write a script to automate the managemen [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] :newPlatformMXBeanProxy instead of MBeanServerInvocationHandler::newProxyInstance based on Daniel comment]  I needed to write a script to automate the managemen [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Mesnil&#8217;s Weblog  &#187; Blog Archive   &#187; JMX Scripts using JRuby &#8212; Part II</title>
		<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/comment-page-1/#comment-34397</link>
		<dc:creator>Jeff Mesnil&#8217;s Weblog  &#187; Blog Archive   &#187; JMX Scripts using JRuby &#8212; Part II</dc:creator>
		<pubDate>Thu, 31 May 2007 09:57:25 +0000</pubDate>
		<guid isPermaLink="false">http://jmesnil.net/weblog/2007/03/13/jmx-scripts-using-jruby/#comment-34397</guid>
		<description>&lt;p&gt;[...] e_method instead of eval based on a poignant explanation of eval-less metaprogramming.  In Part I, I created a JRuby script to manage a Java application using JMX.  In this e [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] e_method instead of eval based on a poignant explanation of eval-less metaprogramming.  In Part I, I created a JRuby script to manage a Java application using JMX.  In this e [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Fuchs</title>
		<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/comment-page-1/#comment-20200</link>
		<dc:creator>Daniel Fuchs</dc:creator>
		<pubDate>Thu, 22 Mar 2007 19:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://jmesnil.net/weblog/2007/03/13/jmx-scripts-using-jruby/#comment-20200</guid>
		<description>&lt;p&gt;Hi Jeff,&lt;/p&gt;

&lt;p&gt;Nice blog entry, but I&#039;d like to bring something to your attention:&lt;/p&gt;

&lt;p&gt;The MBeans used in the JVM Management &amp; Monitoring API are not 
regular MBeans, they&#039;re MXBeans. 
Although generic support for custom MXBeans was only added in JDK 6,
JDK 5 had a built-in support for M&amp;M MXBeans.&lt;/p&gt;

&lt;p&gt;In the general case, using MBeanServerInvocationHandler.newProxyInstance
&lt;strong&gt;does not work&lt;/strong&gt; for MXBean interfaces. Instead you should be
using ManagementFactory.newPlatformMXBeanProxy as I have explained 
in one of my posts:
&lt;a href=&quot;http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm#comment-1174563727000&quot;&gt;http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm#comment-1174563727000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MBeanServerInvocationHandler.newProxyInstance works only for regular 
MBeans.&lt;/p&gt;

&lt;p&gt;In other words:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JDK 6 JMX.newMBeanProxy is equivalent to JDK 5 
MBeanServerInvocationHandler.newProxyInstance&lt;/li&gt;
&lt;li&gt;JDK 6 JMX.newMXBeanProxy is a more general method for JDK 5 
ManagementFactory.newPlatformMXBeanProxy (newMXBeanProxy works
for any MXBeans, newPlatformMXBeanProxy will/might only work for 
platform MXBeans).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you should correct your code and use 
ManagementFactory.newPlatformMXBeanProxy instead of 
MBeanServerInvocationHandler.newProxyInstance.&lt;/p&gt;

&lt;p&gt;Hope this helps,&lt;/p&gt;

&lt;p&gt;-- daniel&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Jeff,</p>

<p>Nice blog entry, but I&#8217;d like to bring something to your attention:</p>

<p>The MBeans used in the JVM Management &amp; Monitoring API are not 
regular MBeans, they&#8217;re MXBeans. 
Although generic support for custom MXBeans was only added in JDK 6,
JDK 5 had a built-in support for M&amp;M MXBeans.</p>

<p>In the general case, using MBeanServerInvocationHandler.newProxyInstance
<strong>does not work</strong> for MXBean interfaces. Instead you should be
using ManagementFactory.newPlatformMXBeanProxy as I have explained 
in one of my posts:
<a href="http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm#comment-1174563727000">http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm#comment-1174563727000</a></p>

<p>MBeanServerInvocationHandler.newProxyInstance works only for regular 
MBeans.</p>

<p>In other words:</p>

<ul>
<li>JDK 6 JMX.newMBeanProxy is equivalent to JDK 5 
MBeanServerInvocationHandler.newProxyInstance</li>
<li>JDK 6 JMX.newMXBeanProxy is a more general method for JDK 5 
ManagementFactory.newPlatformMXBeanProxy (newMXBeanProxy works
for any MXBeans, newPlatformMXBeanProxy will/might only work for 
platform MXBeans).</li>
</ul>

<p>So you should correct your code and use 
ManagementFactory.newPlatformMXBeanProxy instead of 
MBeanServerInvocationHandler.newProxyInstance.</p>

<p>Hope this helps,</p>

<p>&#8211; daniel</p>]]></content:encoded>
	</item>
</channel>
</rss>

