/** * Subscribes a listener MBean for JMX notifications. * * @param dynamicSubscriptions indicates whether to monitor and subscribe * to new MBeans that match the specification. * @param listener the receiver of the notifications. * @throws Exception for any error **/ public void subscribe(boolean dynamicSubscriptions, ObjectName listener) throws Exception { // we need an xml subscription specification if (this.xmllist != null && this.sublist == null) { // Parse the XML spec log.debug("Parsing subscription specification"); List subscriptionList = parseXMLSubscriptionSpec(this.xmllist); subscribe(subscriptionList, dynamicSubscriptions, listener); } else if (this.sublist != null) { subscribe(sublist, dynamicSubscriptions, listener); } else log.debug("Subscription specification not provided"); }
/** * Subscribes a listener MBean for JMX notifications. * * @param dynamicSubscriptions indicates whether to monitor and subscribe * to new MBeans that match the specification. * @param listener the receiver of the notifications. * @throws Exception for any error **/ public void subscribe(boolean dynamicSubscriptions, ObjectName listener) throws Exception { // we need an xml subscription specification if (this.xmllist != null && this.sublist == null) { // Parse the XML spec log.debugf("Parsing subscription specification"); List subscriptionList = parseXMLSubscriptionSpec(this.xmllist); subscribe(subscriptionList, dynamicSubscriptions, listener); } else if (this.sublist != null) { subscribe(sublist, dynamicSubscriptions, listener); } else log.debugf("Subscription specification not provided"); }