Package javax.management

Examples of javax.management.MBeanServer.removeNotificationListener()


      server.addNotificationListener(objectName, listener1, null, null);
      server.addNotificationListener(objectName, listener2, null, null);
      assertEquals(emitter.getNotificationListeners().size(), 2);

      server.removeNotificationListener(objectName, listener1, null, null);
      assertEquals(emitter.getNotificationListeners().size(), 1);

      server.removeNotificationListener(objectName, listener2, null, null);
      assertEquals(emitter.getNotificationListeners().size(), 0);
   }
View Full Code Here


      assertEquals(emitter.getNotificationListeners().size(), 2);

      server.removeNotificationListener(objectName, listener1, null, null);
      assertEquals(emitter.getNotificationListeners().size(), 1);

      server.removeNotificationListener(objectName, listener2, null, null);
      assertEquals(emitter.getNotificationListeners().size(), 0);
   }

   public void testAddRemoveOneListenerOnTwoMBeans() throws Exception
   {
View Full Code Here

      server.addNotificationListener(objectName2, listener, null, null);
      assertEquals(emitter1.getNotificationListeners().size(), 1);
      assertEquals(emitter2.getNotificationListeners().size(), 1);

      server.removeNotificationListener(objectName1, listener, null, null);
      assertEquals(emitter1.getNotificationListeners().size(), 0);
      assertEquals(emitter2.getNotificationListeners().size(), 1);

      server.removeNotificationListener(objectName2, listener, null, null);
      assertEquals(emitter1.getNotificationListeners().size(), 0);
View Full Code Here

      server.removeNotificationListener(objectName1, listener, null, null);
      assertEquals(emitter1.getNotificationListeners().size(), 0);
      assertEquals(emitter2.getNotificationListeners().size(), 1);

      server.removeNotificationListener(objectName2, listener, null, null);
      assertEquals(emitter1.getNotificationListeners().size(), 0);
      assertEquals(emitter2.getNotificationListeners().size(), 0);
   }

   public interface IdentityEmitterMBean
View Full Code Here

         {
         }
      };
      server.addNotificationListener(defaultName, listener, null, null);
      // Remove throws if the listener is not found
      server.removeNotificationListener(defaultName, listener);

      // Invoke operations
      server.getAttribute(defaultName, "MBeanServerId");

      // Metadata
View Full Code Here

      // Be sure the listener is called
      assertEquals("Listener is not called", integer.get(), 2);

      // Remove one listener
      server.removeNotificationListener(name1, listener);

      // Be sure it is not called
      mbean1.sendNotification(notification);
      assertEquals("Listener is called", integer.get(), 2);
View Full Code Here

      mbean2.sendNotification(notification);
      assertEquals("Listener is not called", integer.get(), 3);

      try
      {
         server.removeNotificationListener(name1, listener);
         fail("Listener has been removed");
      }
      catch (ListenerNotFoundException ignored)
      {
      }
View Full Code Here

      catch (ListenerNotFoundException ignored)
      {
      }

      // Remove also the second listener
      server.removeNotificationListener(name2, listener);

      // Be sure it is not called
      mbean2.sendNotification(notification);
      assertEquals("Listener is called", integer.get(), 3);
   }
View Full Code Here

      // Be sure the listeners are called
      assertEquals("Listeners are not called", integer.get(), 3);

      // Remove one listener
      server.removeNotificationListener(name2, listener);

      // Be sure the listener is called
      mbean2.sendNotification(notification);
      assertEquals("Listener is not called", integer.get(), 4);
View Full Code Here

      // Be sure it is called
      mbean1.sendNotification(notification);
      assertEquals("Listener is not called", integer.get(), 5);

      server.removeNotificationListener(name1, listener);

      // Be sure it is not called
      mbean1.sendNotification(notification);
      assertEquals("Listener is called", integer.get(), 5);
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.