Package javax.management

Examples of javax.management.NotificationFilterSupport


            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
        }
        RMIServerSocketFactory serverSocketFactory = new GeronimoRMIServerSocketFactory(host);
        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, serverSocketFactory);
        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);
        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(classLoader);
        try {
            server.start();
View Full Code Here


        } else {
            log.warn("Starting unauthenticating JMXConnector for " + serviceURL);
        }
        MBeanServer mbeanServer = new MBeanServerDelegate(kernel);
        server = JMXConnectorServerFactory.newJMXConnectorServer(serviceURL, 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.info("Started JMXConnector " + server.getAddress());
    }
View Full Code Here

        //Add the custom invoker as an MBeanServerForwarder, and start the RMIConnectorServer.
        MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance();
        _cs.setMBeanServerForwarder(mbsf);

        NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(JMXConnectionNotification.OPENED);
        filter.enableType(JMXConnectionNotification.CLOSED);
        filter.enableType(JMXConnectionNotification.FAILED);
        // Get the handler that is used by the above MBInvocationHandler Proxy.
        // which is the MBeanInvocationHandlerImpl and so also a NotificationListener
        _cs.addNotificationListener((NotificationListener) Proxy.getInvocationHandler(mbsf), filter, null);

        _cs.start();
View Full Code Here

    }

    private void registerNotification()
        throws InstanceNotFoundException
    {
        final NotificationFilterSupport notificationFilter = new NotificationFilterSupport() ;
        notificationFilter.enableType(Server.START_NOTIFICATION_TYPE) ;

        final ObjectName serverName = ObjectNameFactory.create("jboss.system:type=Server") ;

        getServer().addNotificationListener(serverName, this, notificationFilter, null) ;
    }
View Full Code Here

    }

    private void registerNotification()
        throws InstanceNotFoundException
    {
        final NotificationFilterSupport notificationFilter = new NotificationFilterSupport() ;
        notificationFilter.enableType(Server.START_NOTIFICATION_TYPE) ;

        final ObjectName serverName = ObjectNameFactory.create("jboss.system:type=Server") ;

        getServer().addNotificationListener(serverName, this, notificationFilter, null) ;
    }
View Full Code Here

     
      MBeanListener listener = new MBeanListener();
      ObjectName listenerName = new ObjectName("test:type=listener");
      server.registerMBean(listener, listenerName);
     
      NotificationFilterSupport filter = new NotificationFilterSupport();
      filter.enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
     
      ObjectName delegateName =
         new ObjectName("JMImplementation:type=MBeanServerDelegate");
      server.addNotificationListener(delegateName, listenerName, filter, "MyHandback");
   
View Full Code Here

         }
      }
     
      MyNotificationListener listener = new MyNotificationListener();
     
      NotificationFilterSupport filter = new NotificationFilterSupport();
      filter.enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
     
      server.addNotificationListener(
            new ObjectName("JMImplementation:type=MBeanServerDelegate"),
            listener, filter, "MyHandback"
      );      
View Full Code Here

   {
      NotificationBroadcasterSupport broadcaster = new NotificationBroadcasterSupport();

      broadcaster.addNotificationListener(new Listener(), null, null);

      broadcaster.addNotificationListener(new Listener(), new NotificationFilterSupport(), null);

      broadcaster.addNotificationListener(new Listener(), null, new Object());

      broadcaster.addNotificationListener(new Listener(), new NotificationFilterSupport(), new Object());
   }
View Full Code Here

  /**
   * Enable some types then disable everyting.
   */
  public void testDisableAllTypes()
  {
    NotificationFilterSupport nfs = new NotificationFilterSupport();
    nfs.enableType("type1");
    nfs.enableType("type2");
    nfs.disableAllTypes();
    assertEquals(false, nfs.isNotificationEnabled(n1));
    assertEquals(false, nfs.isNotificationEnabled(n2));
    assertEquals(false, nfs.isNotificationEnabled(n3));
    assertEquals(false, nfs.isNotificationEnabled(n4));
    assertEquals(false, nfs.isNotificationEnabled(n5));
  }
View Full Code Here

  /**
   * Enable some types the disable one of them.
   */
  public void testDisableType()
  {
    NotificationFilterSupport nfs = new NotificationFilterSupport();
    nfs.enableType("type1");
    nfs.enableType("type2");
    nfs.disableType("type1");
    assertEquals(false, nfs.isNotificationEnabled(n1));
    assertEquals(false, nfs.isNotificationEnabled(n2));
    assertEquals(false, nfs.isNotificationEnabled(n3));
    assertEquals(true, nfs.isNotificationEnabled(n4));
    assertEquals(true, nfs.isNotificationEnabled(n5));
  }
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.