1 23 24 41 42 package com.sun.enterprise.admin.monitor.registry.spi; 43 import javax.management.*; 44 import com.sun.enterprise.admin.common.ObjectNames; 45 import java.util.logging.*; 46 import com.sun.enterprise.admin.common.constant.AdminConstants; 48 53 54 class DottedNameRegistrar { 55 final MBeanServer server; 56 final ObjectName registryName; 57 private static final Logger logger = Logger.getLogger(AdminConstants.kLoggerName); 58 59 60 DottedNameRegistrar(MBeanServer server) { 61 this.server=server; 62 registryName = ObjectNames.getDottedNameMonitoringRegistryObjectName(); 63 } 64 65 void registerDottedName(java.lang.String dottedName, ObjectName objectName) { 66 try{ 67 server.invoke(registryName, "add", 68 new Object []{dottedName, objectName}, 69 new String []{String .class.getName(), ObjectName.class.getName()}); 70 } 71 catch(Exception e){ 72 logger.fine(e.getClass().getName()+":"+e.getLocalizedMessage()); 73 } 74 } 75 76 void unregisterDottedName(java.lang.String dottedName) { 77 try{ 78 server.invoke(registryName, "remove", 79 new Object []{dottedName}, 80 new String []{String .class.getName()}); 81 } 82 catch(Exception e){ 83 logger.fine(e.getClass().getName()+":"+e.getLocalizedMessage()); 84 } 85 } 86 } 87 | Popular Tags |