List of usage examples for javax.management.relation MBeanServerNotificationFilter enableObjectName
public synchronized void enableObjectName(ObjectName objectName) throws IllegalArgumentException
From source file:org.mule.providers.jmx.JmxEndpointBuilder.java
private void setNotificationMBeans(MBeanServerNotificationFilter filter, String[] onames) throws MalformedObjectNameException { if (onames.length == 0) return;/* w ww . j a v a 2s . c o m*/ if (onames[0].equals("!*")) { filter.disableAllObjectNames(); } for (String oname : onames) { boolean shallEnable = !oname.startsWith("!"); if (shallEnable) { oname = oname.substring(1); } if ("*".equals(oname)) { if (shallEnable) { filter.enableAllObjectNames(); } else { filter.disableAllObjectNames(); } continue; } try { ObjectName objName = new ObjectName(oname); if (shallEnable) { filter.enableObjectName(objName); } else { filter.disableObjectName(objName); } } catch (Exception e) { logger.warn("Could not " + (shallEnable ? "enable" : "disable") + " " + oname, e); } } }