|
From: Bordet, S. <Sim...@co...> - 2002-01-28 20:48:26
|
Hi Roger,
> Many thanks for pursuing this - lets just see if I understand=20
> correctly?
>=20
> Unless the functionality of a Dynamic/ModelMBean is published via its
> MBeanInfo, it will not be accessible as part of the=20
> management interface=20
> via the mbean server?
Correct.
> The functionality that is exposed via the MBeanInfo will not=20
> be accessible until
> the MBean has been successfully registered with the server.
Correct.
> It would therefore, not be a good idea to try & expose any of=20
> the following=20
> ModelMBean methods via the MBeanInfo:
> - setModelMBeanInfo
> - setManagedResource
> - load
> - store
>=20
> Is that about it?
Correct.
Add also methods from NotificationBroadcaster interfaces.
The above holds for ModelMBeans, however, whose implementation is
already given.
For plain dynamic MBeans, however, the implementor is responsible of
both the metadata and the dispatching.
So you can implement a dynamic MBean that implements also
PersistentMBean, and expose load and store via the management interface,
since you also implement invoke. Same for NotificationBroadcaster
interface.
For example, (the spec is unclear on this) it is said that if listeners
are registered via MBeanServer, then the field source of the
Notification emitted is not the direct reference, but instead the object
name of the emitter.
Now, if you implement a std or dyn MBean that expose also
add/removeNotificationListener via management interface, you have 2 ways
of registering listeners:
server.addNotificationListener(...)
and
server.invoke("addNotificationListener", ...)
that will result in the notification having as source field the object
name and the direct reference respectively.
Both the RI and OpenJMX returns now the direct reference. OpenJMX for
now, until the spec will clear this point.
The above to say that there is a possibility to have methods of
implemented interfaces be part of the management interface. Necessary
condition is being in control of management interface and dispatching.
With std and dyn MBean you have this control; with ModelMBeans,
dispatching is not under control of the user.
Regards
Simon
|