Examples of NotificationListener


Examples of javax.management.NotificationListener

    /**********  Notifications **********/

    public void testNotificationListenerCalled() throws Exception
    {
        NotificationListener listener = mock(NotificationListener.class);
        _queueMBean.addNotificationListener(listener, null, null);

        NotificationCheck notification = mock(NotificationCheck.class);
        String notificationMsg = "Test notification message";

View Full Code Here

Examples of javax.management.NotificationListener

                                            isNull());
    }

    public void testAddRemoveNotificationListener() throws Exception
    {
        NotificationListener listener1 = mock(NotificationListener.class);
        _queueMBean.addNotificationListener(listener1, null, null);
        _queueMBean.removeNotificationListener(listener1);
    }
View Full Code Here

Examples of javax.management.NotificationListener

        _queueMBean.removeNotificationListener(listener1);
    }

    public void testRemoveUnknownNotificationListener() throws Exception
    {
        NotificationListener listener1 = mock(NotificationListener.class);
        try
        {
            _queueMBean.removeNotificationListener(listener1);
            fail("Exception not thrown");
        }
View Full Code Here

Examples of javax.management.NotificationListener

            // if we are not already an ObjectName (compliant with RI behaviour)
            notification.setSource(objectName);
         }

         // Notify the real listener
         NotificationListener listener = getTargetListener();
         listener.handleNotification(notification, handback);
      }
View Full Code Here

Examples of javax.management.NotificationListener

      {
         ObjectName name = names[i];
         MarshalledObject filter = filters[i];
         NotificationFilter f = (NotificationFilter)RMIMarshaller.unmarshal(filter, server.getClassLoaderFor(name), defaultLoader);
         Integer id = notificationHandler.generateListenerID(name, f);
         NotificationListener listener = notificationHandler.getServerNotificationListener();
         server.addNotificationListener(name, listener, f, id);
         notificationHandler.addNotificationListener(id, new NotificationTuple(name, listener, f, id));
         ids.add(id);
      }
      return (Integer[])ids.toArray(new Integer[ids.size()]);
View Full Code Here

Examples of javax.management.NotificationListener

         }
      }

      RmiConnectorActivator.log(LogService.LOG_DEBUG,"Sending Notification " + notif + ", listener info is " + tuple,null);

      NotificationListener listener = tuple.getNotificationListener();

      try
      {
         listener.handleNotification(notif, tuple.getHandback());
      }
      catch (RuntimeException x)
      {
         RmiConnectorActivator.log(LogService.LOG_WARNING,"RuntimeException caught from handleNotification, listener = " + listener, x);
         // And return quietly
View Full Code Here

Examples of javax.management.NotificationListener

        // notifications

        final List<Notification> received = new ArrayList<Notification>();

        mbeanServer.addNotificationListener(new ObjectName(BundleStateMBean.OBJECTNAME), new NotificationListener() {
            public void handleNotification(Notification notification, Object handback) {
               received.add(notification);
            }
        }, null, null);
View Full Code Here

Examples of javax.management.NotificationListener

       
        // notifications
       
        final List<Notification> received = new ArrayList<Notification>();
     
        mbeanServer.addNotificationListener(new ObjectName(ServiceStateMBean.OBJECTNAME), new NotificationListener() {
            public void handleNotification(Notification notification, Object handback) {
               received.add(notification);
            }
        }, null, null);
       
View Full Code Here

Examples of javax.management.NotificationListener

       
        // notifications
       
        final List<Notification> received = new ArrayList<Notification>();
     
        mbeanServer.addNotificationListener(new ObjectName(BundleStateMBean.OBJECTNAME), new NotificationListener() {
            public void handleNotification(Notification notification, Object handback) {
               received.add(notification);
            }
        }, null, null);
       
View Full Code Here

Examples of javax.management.NotificationListener

       
        // notifications
       
        final List<Notification> received = new ArrayList<Notification>();
     
        mbeanServer.addNotificationListener(new ObjectName(ServiceStateMBean.OBJECTNAME), new NotificationListener() {
            public void handleNotification(Notification notification, Object handback) {
               received.add(notification);
            }
        }, null, null);
       
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.