Package javax.management

Examples of javax.management.NotificationFilter


        MockControl controlNotificationListener = MockControl.createControl(NotificationListener.class);
        NotificationListener mockNotificationListener = (NotificationListener) controlNotificationListener.getMock();

        MockControl controlNotificationFilter = MockControl.createControl(NotificationFilter.class);
        NotificationFilter mockNotificationFilter = (NotificationFilter) controlNotificationFilter.getMock();

        controlNotificationFilter.replay();
        controlNotificationListener.replay();

        try
View Full Code Here


        MockControl controlNotificationListener = MockControl.createControl(NotificationListener.class);
        NotificationListener mockNotificationListener = (NotificationListener) controlNotificationListener.getMock();

        MockControl controlNotificationFilter = MockControl.createControl(NotificationFilter.class);
        NotificationFilter mockNotificationFilter = (NotificationFilter) controlNotificationFilter.getMock();

        mockNotificationFilter.isNotificationEnabled(null);
        controlNotificationFilter.setMatcher(MockControl.ALWAYS_MATCHER);
        controlNotificationFilter.setReturnValue(true);
       
        mockNotificationListener.handleNotification(null, null);
        controlNotificationListener.setMatcher(MockControl.ALWAYS_MATCHER);
View Full Code Here

      getServer().addNotificationListener
      (
         managedConnectionFactoryName,
         this,
         new NotificationFilter()
         {
            private static final long serialVersionUID = -9211456539783257343L;

            public boolean isNotificationEnabled(Notification n)
            {
View Full Code Here

                    Object.class.getName(),
                    Date.class.getName(),
                    "long",});

        // Add indexer as listener to index notifications
        NotificationFilter filter = new TimerFilter(id);
        server.addNotificationListener(timer, indexRunner, filter, null);
    }
View Full Code Here

        throws InstanceNotFoundException, IOException {

        checkNonNull("Target MBean name", name);
        checkNonNull("Listener MBean name", listener);

        final NotificationFilter filterValue;
        final Object handbackValue;
        final boolean debug=logger.debugOn();

        final ClassLoader targetCl = getClassLoaderFor(name);
View Full Code Here

        IOException {

        checkNonNull("Target MBean name", name);
        checkNonNull("Listener MBean name", listener);

        final NotificationFilter filterValue;
        final Object handbackValue;
        final boolean debug=logger.debugOn();

        final ClassLoader targetCl = getClassLoaderFor(name);
View Full Code Here

     * Adds a notification listener to the target bean.
     * @throws Exception
     */
    protected void addNotificationListener() throws Exception {
        JMXEndpoint ep = (JMXEndpoint) getEndpoint();
        NotificationFilter nf = ep.getNotificationFilter();

        ObjectName objectName = ep.getJMXObjectName();

        getServerConnection().addNotificationListener(objectName, this, nf, ep.getHandback());
    }
View Full Code Here

    CountingAttributeChangeNotificationListener listener = new CountingAttributeChangeNotificationListener();

    NotificationListenerBean listenerBean = new NotificationListenerBean();
    listenerBean.setNotificationListener(listener);
    listenerBean.setNotificationFilter(new NotificationFilter() {
      @Override
      public boolean isNotificationEnabled(Notification notification) {
        if (notification instanceof AttributeChangeNotification) {
          AttributeChangeNotification changeNotification = (AttributeChangeNotification) notification;
          return "Name".equals(changeNotification.getAttributeName());
View Full Code Here

        // register the NotificationListener
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=eventnotifiers,name=JmxEventNotifier");
        MyNotificationListener listener = new MyNotificationListener();  
        context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,
            listener,                                                                                        
            new NotificationFilter() {
                public boolean isNotificationEnabled(Notification notification) {
                    return notification.getSource().equals("MyCamel");
                }
            }, null);
View Full Code Here

    public void testExchangeFailed() throws Exception {
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=eventnotifiers,name=JmxEventNotifier");
       
        MyNotificationListener listener = new MyNotificationListener();  
        context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,
            listener, new NotificationFilter() {
                public boolean isNotificationEnabled(Notification notification) {
                    return true;
                }
            }, null);
       
View Full Code Here

TOP

Related Classes of javax.management.NotificationFilter

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.