Skip to main content

Blog Archive for emcmanus during July 2005

The consistently excellent Brian Goetz has written a new article in his Java Theory and Practice series entitled "Be a good (event) listener". Since listeners are an important part of the JMX API, here's how his advice applies there. There are really two sets of recommendations, one for event generators and one for event listeners. In the JMX API, events are instances of Notification, event...
With a Standard MBean, you define the management interface of the MBean using a Java interface. Getters and setters in the interface define attributes, and other methods define operations. But the only information extracted out of the interface is the names and types of the attributes and operations, and just the types of the operation parameters. Although the JMX API allows...
Yesterday I talked about how you can use WeakReference to allow a resource to be garbage collected even if it is referenced by another object, a JMX MBean in the case in question. In fact, you can use dynamic proxies to provide a more general framework for this sort of situation. In the specific situation I was discussing before, you have a resource such as a...
Suppose (to take my favourite example), you have some sort of cache, and you want to be able to control it via an MBean. You might have something a bit like this: public interface CacheControlMBean {    public int getSize();}public class CacheControl implements CacheControlMBean {    public CacheControl(Cache cache) {      ...
One of the changes we made in version 1.1 of the JMX API, way back in early 2002, was to modify the serialization of certain classes. Because remote access was not part of the API at this time, this aspect had been a bit neglected in version 1.0, with the result that certain classes had underspecified or inefficient serial forms. Other implementations of the API could and did have incompatible...
The short answer is: you can, but you probably shouldn't. Here's why. To be clear, here's the sort of thing I'm talking about: CacheControlMBean mbean = new CacheControl(thingyCache);mbeanServer.registerMBean(mbean, objectName1);mbeanServer.registerMBean(mbean, objectName2); This will work, and the same MBean will be accessible through both objectName1 and objectName2. So why...
JavaOne is always a huge buzz, and this year was no exception. Of course the technical sessions are very worthwhile, so it's great news that slides and audio for all of them will be available free online. In previous years you had to pay a small subscription fee to access them. But the biggest plus of JavaOne, like any conference, is meeting people with common interests. I brought back a...