*/
public void removeNotificationListener(ObjectName name,
NotificationListener listener, NotificationFilter filter, Object handback)
throws InstanceNotFoundException, ListenerNotFoundException
{
MBeanEntry entry = registry.get(name);
if (NotificationBroadcaster.class.isInstance(entry.getResourceInstance()) == false)
throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
checkMBeanPermission(entry.getResourceClassName(), null, name,
"removeNotificationListener");
ClassLoader newTCL = entry.getClassLoader();
ClassLoader oldTCL = TCLAction.UTIL.getContextClassLoader();
final boolean setCl = newTCL != oldTCL && newTCL != null;
try
{
if (setCl)
TCLAction.UTIL.setContextClassLoader(newTCL);
listeners.remove(entry.getObjectName(), listener, filter, handback);
}
finally
{
if (setCl)
TCLAction.UTIL.setContextClassLoader(oldTCL);