Package javax.management

Examples of javax.management.NotificationFilterSupport


   static final String NOTIFICATION_TYPE = "notificationType";
   private static final QName NOTIFICATION_TYPE_QNAME = new QName("", NOTIFICATION_TYPE);

   public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException
   {
      NotificationFilterSupport filter = (NotificationFilterSupport)value;
      context.startElement(name, attributes);
      onSerialize(context, filter);
      context.endElement();
   }
View Full Code Here


     * Object)
     */
    public final void testRemoveNotificationListenerNotificationListenerNotificationFilterObject()
            throws Exception {
        // Register a listener
        NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED);
        SimpleTestListener listener = new SimpleTestListener();
        notifierBean.addNotificationListener(listener, filter, null);

        // Fire off a notification and ensure that the listener receives it.
        MemoryUsage mu = new MemoryUsage(1, 2, 3, 4);
View Full Code Here

        createWidgets();
        populateWidgets();

        // register for Notifications if LoggerContext MBean was added/removed
        ObjectName addRemoveNotifs = MBeanServerDelegate.DELEGATE_NAME;
        NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(Server.DOMAIN); // only interested in Log4J2 MBeans
        client.getConnection().addNotificationListener(addRemoveNotifs, this, null, null);
    }
View Full Code Here

        return scrollStatusLog;
    }

    private void registerListeners(StatusLoggerAdminMBean status) throws InstanceNotFoundException,
            MalformedObjectNameException, IOException {
        final NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(StatusLoggerAdminMBean.NOTIF_TYPE_MESSAGE);
        final ObjectName objName = status.getObjectName();
        // System.out.println("Add listener for " + objName);
        client.getConnection().addNotificationListener(objName, this, filter, status.getContextName());
    }
View Full Code Here

            env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
        } else {
            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
        }
        server = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mbeanServer);
        NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(JMXConnectionNotification.OPENED);
        filter.enableType(JMXConnectionNotification.CLOSED);
        filter.enableType(JMXConnectionNotification.FAILED);
        server.addNotificationListener(authenticator, filter, null);
        server.start();
        log.debug("Started JMXConnector " + server.getAddress());
    }
View Full Code Here

            env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
        } else {
            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
        }
        server = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mbeanServer);
        NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(JMXConnectionNotification.OPENED);
        filter.enableType(JMXConnectionNotification.CLOSED);
        filter.enableType(JMXConnectionNotification.FAILED);
        server.addNotificationListener(authenticator, filter, null);
        server.start();
        log.debug("Started JMXConnector " + server.getAddress());
    }
View Full Code Here

      final Set<AMX>  all = getAllAMX();
     
      final NotificationListener  listener1    = new DummyListener();
      final NotificationListener  listener2    = new DummyListener();
     
      final NotificationFilter    filter  = new NotificationFilterSupport();
      final Object    handback    = "handback";
     
      for( final AMX amx : all )
      {
          amx.getNotificationInfo();
View Full Code Here

        try {
            logger.log(Level.FINE,
                "Adding Discovery Listener for Application Server");

            NotificationFilterSupport filter = new NotificationFilterSupport();
            filter.enableType(Constants.PRODUCT_NAME);

            ObjectName dson = new ObjectName(Constants.DIS_OBJ_NAME);
            getMbs().addNotificationListener(dson, this, filter, null);
        } catch (Exception e) {
            logger.log(Level.SEVERE,
View Full Code Here

  {
      String[]    types   = NO_TYPES;
     
      if ( filter instanceof NotificationFilterSupport )
      {
          final NotificationFilterSupport fs  = (NotificationFilterSupport)filter;
         
          types   = ListUtil.toStringArray( fs.getEnabledTypes() );
      }
      else if ( filter instanceof AttributeChangeNotificationFilter )
      {
          types   = ATTRIBUTE_CHANGE_TYPES;
      }
View Full Code Here

         String type = "notification.type";

         // First listener
         mbsc.addNotificationListener(emitterName, listener1, null, null);
         // Second listener
         NotificationFilterSupport filter = new NotificationFilterSupport();
         filter.enableType(type);
         mbsc.addNotificationListener(emitterName, listener1, filter, null);
         // Third listener
         Object handback = new Object();
         mbsc.addNotificationListener(emitterName, listener1, null, handback);
         // Fourth listener
View Full Code Here

TOP

Related Classes of javax.management.NotificationFilterSupport

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.