<?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"
	>
<channel>
	<title>Comments on: 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>
	<pubDate>Sat, 19 Jul 2008 06:42:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: GSIY &#8230; Ruby-Rails Portal</title>
		<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/#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>[...]  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 [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;]  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 [&#8230;]</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-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>[...] :newPlatformMXBeanProxy instead of MBeanServerInvocationHandler::newProxyInstance based on Daniel comment]  I needed to write a script to automate the managemen [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] :newPlatformMXBeanProxy instead of MBeanServerInvocationHandler::newProxyInstance based on Daniel comment]  I needed to write a script to automate the managemen [&#8230;]</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-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>[...] 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 [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 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 [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Fuchs</title>
		<link>http://jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/#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>Hi Jeff,

Nice blog entry, but I'd like to bring something to your attention:

The MBeans used in the JVM Management &#38; Monitoring API are not 
regular MBeans, they're MXBeans. 
Although generic support for custom MXBeans was only added in JDK 6,
JDK 5 had a built-in support for M&#38;M MXBeans.

In the general case, using MBeanServerInvocationHandler.newProxyInstance
__does not work__ for MXBean interfaces. Instead you should be
using ManagementFactory.newPlatformMXBeanProxy as I have explained 
in one of my posts:
[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)

MBeanServerInvocationHandler.newProxyInstance works only for regular 
MBeans.

In other words:

* JDK 6 JMX.newMBeanProxy is equivalent to JDK 5 
MBeanServerInvocationHandler.newProxyInstance
* 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).

So you should correct your code and use 
ManagementFactory.newPlatformMXBeanProxy instead of 
MBeanServerInvocationHandler.newProxyInstance.

Hope this helps,

-- daniel</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<br />
regular MBeans, they&#8217;re MXBeans.<br />
Although generic support for custom MXBeans was only added in JDK 6,<br />
JDK 5 had a built-in support for M&amp;M MXBeans.</p>
<p>In the general case, using MBeanServerInvocationHandler.newProxyInstance<br />
<strong>does not work</strong> for MXBean interfaces. Instead you should be<br />
using ManagementFactory.newPlatformMXBeanProxy as I have explained<br />
in one of my posts:<br />
<a href="http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm#comment-1174563727000"></a><a href="http://blogs.sun.com/jmxetc/entry/how" rel="nofollow">http://blogs.sun.com/jmxetc/entry/how</a><em>to</em>retrieve<em>remote</em>jvm#comment-1174563727000</p>
<p>MBeanServerInvocationHandler.newProxyInstance works only for regular<br />
MBeans.</p>
<p>In other words:</p>
<ul>
<li>JDK 6 JMX.newMBeanProxy is equivalent to JDK 5<br />
MBeanServerInvocationHandler.newProxyInstance</li>
<li>JDK 6 JMX.newMXBeanProxy is a more general method for JDK 5<br />
ManagementFactory.newPlatformMXBeanProxy (newMXBeanProxy works<br />
for any MXBeans, newPlatformMXBeanProxy will/might only work for<br />
platform MXBeans).</li>
</ul>
<p>So you should correct your code and use<br />
ManagementFactory.newPlatformMXBeanProxy instead of<br />
MBeanServerInvocationHandler.newProxyInstance.</p>
<p>Hope this helps,</p>
<p>&#8211; daniel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
