Package javax.management

Examples of javax.management.MBeanServerConnection.removeNotificationListener()


      for(int n = 0; n < 10; n ++)
         drm0.remove("key"+n);

      server0.removeNotificationListener(drmService, listener);
      server1.removeNotificationListener(drmService, listener);
   }

}
View Full Code Here


      System.out.println("Return to doSomething() is " + ret);

      // give time for notification to come in
      Thread.currentThread().sleep(5000);

      connection.removeNotificationListener(objName, listener);

      System.out.println("Removed notification listener.");

   }
View Full Code Here

         assertNull(handbackHolder.get());

         // Disable filtering
         filter.enableAllObjectNames();
         // Remove and readd: on server side there is a serialized copy of the filter
         mbsc.removeNotificationListener(emitterName, listenerName);
         mbsc.addNotificationListener(emitterName, listenerName, filter, handback);

         // Wait for notifications threads to start
         sleep(1000);
View Full Code Here

         if (!(notification instanceof MBeanServerNotification)) fail();
         assertEquals(((MBeanServerNotification) emitted).getMBeanName(), name);
         notificationHolder.set(null);
         handbackHolder.set(null);

         mbsc.removeNotificationListener(emitterName, listenerName, filter, handback);

         // Be sure we don't get notifications anymore
         emitter.emit(notification);

         // Wait for notification to arrive
View Full Code Here

         Notification emitted = (Notification) notificationHolder.get();
         assertNotNull(emitted);
         notificationHolder.set(null);
         handbackHolder.set(null);

         mbsc.removeNotificationListener(emitterName, listener, filter, null);

         // Be sure we don't get notifications anymore
         emitter.emit(notification);

         // Wait for notification to arrive
View Full Code Here

         Notification emitted = (Notification) notificationHolder.get();
         assertNotNull(emitted);
         notificationHolder.set(null);
         handbackHolder.set(null);

         mbsc.removeNotificationListener(emitterName, listener, null, handback);

         // Be sure we don't get notifications anymore
         emitter.emit(notification);

         // Wait for notification to arrive
View Full Code Here

         assertEquals(counter2.get(), 1);
         counter1.set(0);
         counter2.set(0);

         // Remove one listener
         mbsc.removeNotificationListener(emitterName, listener1, null, handback);

         emitter.emit(notification);
         // Wait for notification to arrive
         sleep(1000);
View Full Code Here

         assertEquals(counter2.get(), 1);
         counter1.set(0);
         counter2.set(0);

         // Remove all listeners
         mbsc.removeNotificationListener(emitterName, listener1);

         emitter.emit(notification);
         // Wait for notification to arrive
         sleep(1000);
View Full Code Here

         assertEquals(counter1.get(), 0);
         assertEquals(counter2.get(), 1);
         counter1.set(0);
         counter2.set(0);

         mbsc.removeNotificationListener(emitterName, listener2);

         emitter.emit(notification);
         // Wait for notification to arrive
         sleep(1000);
View Full Code Here

         // Be sure it's received
         assertEquals(counter.get(), 1);

         // Be sure I can remove the same listener from another MBeanServerConnection
         MBeanServerConnection mbsc2 = cntor.getMBeanServerConnection();
         mbsc2.removeNotificationListener(emitterName, listener, null, null);

         emitter.emit(notification);

         // Be sure no listeners anymore
         assertEquals(counter.get(), 1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.