Package javax.management

Examples of javax.management.MBeanServerConnection.addNotificationListener()


            filter.enableType(CacheMgmtInterceptor.NOTIF_NODE_REMOVED);
            filter.enableType(CacheMgmtInterceptor.NOTIF_NODE_MODIFIED);

            // register the listener with a filter
            // leave the filter null to receive all cache events
            server.addNotificationListener(mgmt_name, listener, filter, null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here


      MBeanServerDelegateMBean delegate = (MBeanServerDelegateMBean)proxy;

      System.out.println(delegate.getImplementationVendor() + " is cool !");

      // Register an MBean, and get notifications via the Hessian protocol
      connection.addNotificationListener(delegateName, new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            System.out.println("Got the following notification: " + notification);
         }
View Full Code Here

      };

      // The MBeanServerDelegate emits notifications about registration/unregistration of MBeans
      ObjectName delegateName = ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate");

      connection.addNotificationListener(delegateName, listener, null, null);

      // Give chance to the notification machinery to setup
      Thread.sleep(1000);

      // Now register a remote MBean, for example an MLet, so that the MBeanServerDelegate
View Full Code Here

      MBeanServerDelegateMBean delegate = (MBeanServerDelegateMBean)proxy;

      System.out.println(delegate.getImplementationVendor() + " is cool !");

      // Register an MBean, and get notifications via the SOAP protocol
      connection.addNotificationListener(delegateName, new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            System.out.println("Got the following notification: " + notification);
         }
View Full Code Here

      MBeanServerDelegateMBean delegate = (MBeanServerDelegateMBean)proxy;

      System.out.println(delegate.getImplementationVendor() + " is cool !");

      // Register an MBean, and get notifications via the Hessian protocol
      connection.addNotificationListener(delegateName, new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            System.out.println("Got the following notification: " + notification);
         }
View Full Code Here

      connection.createMBean(Sample.class.getName(), objName);
      Object ret = connection.invoke(objName, "doSomething", new Object[] {"foo"}, new String[] {String.class.getName()});
      System.out.println("Return to doSomething() is " + ret);

      NotificationListener listener = new Listener();
      connection.addNotificationListener(objName,listener, null, null);

      ret = connection.invoke(objName, "doSomething", new Object[] {"bar"}, new String[] {String.class.getName()});
      System.out.println("Return to doSomething() is " + ret);

      // give time for notification to come in
View Full Code Here

       
        if (mbsc == null)
        {
            throw new ManagementConsoleException("Server connection is broken");
        }
        mbsc.addNotificationListener(jmxbean.getObjectName(), serverRegistry.getNotificationListener(), null, null);
    }
   
    public static void removeNotificationListener(ManagedBean mbean, String name, String type) throws Exception
    {
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
View Full Code Here

         cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
         MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
         ObjectName delegate = new ObjectName("JMImplementation:type=MBeanServerDelegate");

         final MutableObject holder = new MutableObject(null);
         mbsc.addNotificationListener(delegate, new NotificationListener()
         {
            public void handleNotification(Notification notification, Object handback)
            {
               holder.set(notification);
            }
View Full Code Here

         sleep(5000);

         cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
         MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
         final MutableObject plainNotification = new MutableObject(null);
         mbsc.addNotificationListener(emitterName, new NotificationListener()
         {
            public void handleNotification(Notification notification, Object handback)
            {
               plainNotification.set(notification);
            }
View Full Code Here

         MBeanServerConnection mbsc = cntor.getMBeanServerConnection();

         // Non-serializable filter
         try
         {
            mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
            {
               public boolean isNotificationEnabled(Notification notification)
               {
                  return false;
               }
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.