|
From: Bordet, S. <Sim...@co...> - 2002-01-28 16:10:45
|
Hi,
> >Hi,
> >
> >> Then, what's the correct way? via
> >> server.setAttribute("ManagedResource",
> >> object)
>=20
> >No, there is no way to do it via MBeanServer.
>=20
> >You must call it directly on the ModelMBean reference.
>=20
> But you should create the ModelMBean via MBeanServer, how can=20
> you access the instance then?
ModelMBean rmmb =3D =
server.instantiate("javax.management.modelmbean.RequiredModelMBean", =
...);
rmmb.setModelMBeanInfo(...);
rmmb.setManagedResource(..., "ObjectReference");
server.registerMBean(rmmb, ...);
No other way.
The first line may be:
ModelMBean rmmb =3D new RequiredModelMBean();
but the rest is mandated.
See also the tests for examples.
Simon
|