gcj & JMX
Andrew Haley
aph@redhat.com
Thu Feb 15 11:07:00 GMT 2007
Andrew John Hughes writes:
> On Wed, 2007年02月14日 at 18:14 +0000, Andrew Haley wrote:
> > >
> > With Classpath, none of this ever happens. Instead,
> > gnu.javax.management.registerMBean(Object, ObjectName) does not call
> > MBeanRegistration.preRegister() unless ObjectName == null.
> >
> > So, the preRegister method is never called.
> >
> > The spec for MBeanServer.registerMBean() says "If the object name
> > given is null, the MBean must provide its own name by implementing the
> > MBeanRegistration interface and returning the name from the
> > preRegister method."
> >
> > I suspect, however, that if the MBean is implements the
> > MBeanRegistration interface we should call the preRegister method
> > regardless.
> >
> > I'm going to try it.
>
> Sounds good to me; I hope this fixes the problem. Maybe I shouldn't
> stick to the specs and just go with common sense in future... ;)
Maybe, although the spec doesn't actually say that regstration should
only be done if there is no name, it just very strongly implies it.
:-)
Andrew.
More information about the Java
mailing list