I recently wanted to add some performance measurements to an
application. To avoid duplicating code everywhere I needed to
make measurements, I coded up a small helper class.
What I wanted to measure was the amount of time taken by
various operations within the application. For each operation, I
wanted to know various statistics about it: how many times it was...
Defining an equals(Object) method in a public class is not
always straightforward. One reason it might not be is that the
answer to the question "are these objects equal?" might be
"who's asking?".
In a very interesting comment
on my previous
blog entry, rullrich suggests that the real problem
is with MBeanInfo.equals.
I'm inclined to disagree, but the...
An inadvertent change in JDK 6 means that MBean attributes and
operations no longer appear in the order they were in a Standard
MBean interface. I wanted to fix this, but now I'm not so sure.
Here's the background. Suppose you have a Standard MBean with
this interface:
public interface PlanetMBean {
public int getMercury();
public String getVenus();...
The JMX API includes the possibility to create "Dynamic
MBeans", whose management interface is determined at run time.
When might that be useful? Here's an example.
In the JMX
forum on the Sun Developer Network, Athar asks
how to load a properties file in a dynamic MBean. I think
that's an excellent question, because it's exactly the example I
usually use for...