DottedNameMBeansIniterpublic class DottedNameMBeansIniter extends Object
Constructors Summary |
---|
public DottedNameMBeansIniter(MBeanServer server)
init( server );
|
Methods Summary |
---|
private com.sun.enterprise.admin.dottedname.DottedNameGetSetMBean | getDottedNameGetSetMBean(javax.management.MBeanServer server, com.sun.enterprise.admin.dottedname.DottedNameRegistry registry, com.sun.enterprise.admin.dottedname.DottedNameRegistry monitoringRegistry)
final String dnClassName= AdminService.getAdminService().getAdminContext().getDottedNameMBeanImplClassName();
final Class dnClass = Class.forName(dnClassName);
final Class[] types = new Class[]{javax.management.MBeanServerConnection.class,
com.sun.enterprise.admin.dottedname.DottedNameRegistry.class,
com.sun.enterprise.admin.dottedname.DottedNameRegistry.class};
final Constructor dnConstructor = dnClass.getConstructor(types);
final Object[] params = new Object[]{server, registry, monitoringRegistry};
final DottedNameGetSetMBean dnMbean = (DottedNameGetSetMBean) dnConstructor.newInstance(params);
return dnMbean;
| public void | init(javax.management.MBeanServer server)
// config registry
final DottedNameRegistry registry = new DottedNameRegistryMBeanImpl();
server.registerMBean( registry, ObjectNames.getDottedNameRegistryObjectName() );
// monitoring registry
final DottedNameRegistry monitoringRegistry = new DottedNameRegistryMBeanImpl();
server.registerMBean( monitoringRegistry, ObjectNames.getDottedNameMonitoringRegistryObjectName() );
/* dotted name get-set
probably would be cleaner to generate proxies for registry & monitoringRegistry, but
that would only matter if these objects were unregistered an re-registered (unlikely).
It is also more efficient to just call them directly.
*/
server.registerMBean(
getDottedNameGetSetMBean(server, registry, monitoringRegistry),
ObjectNames.getDottedNameGetSetObjectName() );
|
|