Sometimes static code isn't enough and you need to build code dynamically, at run time. That's usually a hefty proposition, but if the code you need to build is just an interface, it's actually relatively simple. Here are some of the reasons you might want to build interfaces at run time and how you might go about it.
This is the title of an excellent new blog entry from my teammate Luis-Miguel Alventosa. It's an exhaustive description of the principal options that are open to you to configure the security of RMI connectors for JMX agents.
I'm on the front page of java.sun.com with an article derived from my blog entries on MXBeans. Janice Heiss helped me reformat these entries (two blog entries plus an extended blog comment) into the article you see today.
Recently I've seen several people ask what the cost of enabling
JMX monitoring on an application is. If I run with
-Dcom.sun.management.jmxremote and connect
jconsole, how much will that affect the performance of my app?
Here are the results of some highly unscientific
I often want to test that my MBeans work correctly when accessed remotely. For example it's easy to accidentally introduce non-serializable objects in them. It's a pain to set up a real remote connection, but you can make a loopback connection in the same JVM to test most of the same things. Here's how.
MBean proxies allow you to access an MBean through a Java
interface, writing proxy.getFoo() instead of
mbeanServer.getAttribute(name, "Foo"). But when you create a
proxy, there is no check that the MBean actually matches the
interface you specify, or even that the MBean exists. Why is
that, and what can you do about it?
MXBeans include a way to handle inter-MBean references
conveniently. You can use this to build an MBean hierarchy that
is simple to navigate.
The Java compiler doesn't save parameter names in the class files it generates. This is a problem for Standard MBeans, because we'd like to show those names in management clients.
Mustang (Java SE 6) includes the ability to give additional
information about MBeans to management clients via
Descriptors, as I described href="http://weblogs.java.net/blog/emcmanus/archive/2005/10/adding_descript.html">previously.
But what if you are not yet able to migrate to the Mustang
JDK 5.0 allows you to make an application monitorable without
writing any extra code, using command-line properties such as
-Dcom.sun.management.jmxremote. But what if the behaviour
obtained using these properties isn't exactly what you want?