Package javax.management

Examples of javax.management.NotificationListener


      MBeanServer server = newMBeanServer();
      IdentityEmitter emitter = new IdentityEmitter();
      ObjectName objectName = ObjectName.getInstance("test:type=emitter");
      server.registerMBean(emitter, objectName);

      NotificationListener listener1 = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
         }
      };

      NotificationListener listener2 = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
         }
      };
View Full Code Here


      server.registerMBean(emitter1, objectName1);
      IdentityEmitter emitter2 = new IdentityEmitter();
      ObjectName objectName2 = ObjectName.getInstance("test:type=emitter2");
      server.registerMBean(emitter2, objectName2);

      NotificationListener listener = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
         }
      };
View Full Code Here

      public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
      {
         NotificationListener[] listens = (NotificationListener[])listeners.toArray(new NotificationListener[0]);
         for (int i = 0; i < listens.length; i++)
         {
            NotificationListener listen = listens[i];
            if (listen == listener)
            {
               super.removeNotificationListener(listener, filter, handback);
               listeners.remove(listener);
               return;
View Full Code Here

      monitor.setGranularityPeriod(1000);
      monitor.setObservedAttribute("dummy");

      final MutableInteger counter = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      monitor.addNotificationListener(new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            counter.set(counter.get() + 1);
            holder.set(notification);
View Full Code Here

      monitor.setGranularityPeriod(1000);
      monitor.setObservedAttribute("dummy");

      final MutableInteger counter = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      monitor.addNotificationListener(new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            counter.set(counter.get() + 1);
            holder.set(notification);
View Full Code Here

            // 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

      target.setInteger(value);
      server.registerMBean(target, name);

      final MutableInteger times = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      NotificationListener listener = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            times.set(times.get() + 1);
            holder.set(notification);
View Full Code Here

      target.setInteger(value);
      server.registerMBean(target, name);

      final MutableInteger times = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      NotificationListener listener = new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            times.set(times.get() + 1);
            holder.set(notification);
View Full Code Here

      monitor.setGranularityPeriod(1000);
      monitor.setObservedAttribute("ObjectCounter");

      final MutableInteger times = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      monitor.addNotificationListener(new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            times.set(times.get() + 1);
            holder.set(notification);
View Full Code Here

      counter.setIntegerCounter(initThreshold.intValue() - 1);

      final MutableInteger times = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
      monitor.addNotificationListener(new NotificationListener()
      {
         public void handleNotification(Notification notification, Object handback)
         {
            times.set(times.get() + 1);
            holder.set(notification);
View Full Code Here

TOP

Related Classes of javax.management.NotificationListener

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.