public synchronized void testMBeanRemoveListener()
throws Exception
{
MBeanServer server = MBeanServerFactory.newMBeanServer();
MBeanListener listener1 = new MBeanListener();
ObjectName listenerName1 = new ObjectName("test:type=listener1");
server.registerMBean(listener1, listenerName1);
MBeanListener listener2 = new MBeanListener("handback2", "handback3");
ObjectName listenerName2 = new ObjectName("test:type=listener2");
server.registerMBean(listener2, listenerName2);
ObjectName delegateName =
new ObjectName("JMImplementation:type=MBeanServerDelegate");