Package mx4j.server.interceptor

Examples of mx4j.server.interceptor.NotificationListenerMBeanServerInterceptor$ListenerWrapperKey


   /**
    * Two listeners, one MBean, two ObjectNames
    */
   public void testAddUnregister4() throws Exception
   {
      NotificationListenerMBeanServerInterceptor interceptor = new NotificationListenerMBeanServerInterceptor();
      interceptor.setEnabled(true);
      List chain = new ArrayList();
      chain.add(interceptor);
      chain.add(new NoOpMBeanServerInterceptor());
      interceptor.setChain(chain);

      MBeanMetaData metadata1 = new NotificationListenerMBeanMetaData(this, ObjectName.getInstance(":type=test1"));
      MBeanMetaData metadata2 = new NotificationListenerMBeanMetaData(this, ObjectName.getInstance(":type=test2"));
      NotificationListener listener1 = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
         }
      };
      NotificationListener listener2 = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
         }
      };

      interceptor.addNotificationListener(metadata1, listener1, null, null);
      interceptor.addNotificationListener(metadata2, listener2, null, null);
      interceptor.registration(metadata1, MBeanServerInterceptor.POST_DEREGISTER);
      assertEquals(1, interceptor.getNotificationListenerWrappers().size());
      assertEquals(1, interceptor.getObjectNames().size());

      interceptor.registration(metadata2, MBeanServerInterceptor.POST_DEREGISTER);
      assertEquals(0, interceptor.getNotificationListenerWrappers().size());
      assertEquals(0, interceptor.getObjectNames().size());
   }
View Full Code Here

TOP

Related Classes of mx4j.server.interceptor.NotificationListenerMBeanServerInterceptor$ListenerWrapperKey

Copyright © 2018 www.massapicom. 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.