FileDocCategorySizeDatePackage
DottedNameMBeansIniter.javaAPI DocGlassfish v2 API4926Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans

DottedNameMBeansIniter

public class DottedNameMBeansIniter extends Object

Fields Summary
Constructors Summary
public DottedNameMBeansIniter(MBeanServer server)

		init( server );
	
Methods Summary
private com.sun.enterprise.admin.dottedname.DottedNameGetSetMBeangetDottedNameGetSetMBean(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 voidinit(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() );