/* */ }
/* */
/* */ public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
/* */ throws InstanceNotFoundException
/* */ {
/* 746 */ MBeanEntry entry = this.registry.get(name);
/* 747 */ if (!NotificationBroadcaster.class.isInstance(entry.getResourceInstance())) {
/* 748 */ throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
/* */ }
/* 750 */ if (listener == null) {
/* 751 */ throw new RuntimeOperationsException(new IllegalArgumentException("Cannot add null listener"));
/* */ }
/* 753 */ checkMBeanPermission(entry.getResourceClassName(), null, name, "addNotificationListener");
/* */
/* 756 */ ClassLoader newTCL = entry.getClassLoader();
/* 757 */ NotificationBroadcaster broadcaster = entry.getInvoker();
/* */
/* 759 */ ClassLoader oldTCL = TCLAction.UTIL.getContextClassLoader();
/* 760 */ boolean setCl = (newTCL != oldTCL) && (newTCL != null);
/* */ try
/* */ {
/* 763 */ if (setCl) {
/* 764 */ TCLAction.UTIL.setContextClassLoader(newTCL);
/* */ }
/* 766 */ this.listeners.add(entry.getObjectName(), broadcaster, listener, filter, handback);
/* */ }
/* */ finally
/* */ {
/* 770 */ if (setCl)
/* 771 */ TCLAction.UTIL.setContextClassLoader(oldTCL);