Package javax.management

Examples of javax.management.NotificationFilter


        // 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() {           
                private static final long serialVersionUID = 1L;

                public boolean isNotificationEnabled(Notification notification) {
                    return notification.getSource().equals("MyCamel");
                }
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() {
                private static final long serialVersionUID = 1L;

                public boolean isNotificationEnabled(Notification notification) {
                    return true;
                }
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

        // register the bean
        mMonitorObjectName = new ObjectName(ep.getObjectDomain(), "name", "camel-jmx-monitor-" + UUID.randomUUID());
        ManagementFactory.getPlatformMBeanServer().registerMBean(bean, mMonitorObjectName);
       
        // add ourselves as a listener to it
        NotificationFilter nf = ep.getNotificationFilter();
        getServerConnection().addNotificationListener(mMonitorObjectName, this, nf, bean);
        bean.start();
    }
View Full Code Here

    @Override
    protected void initRegistry() {
        super.initRegistry();

        // initialize the registry with our filter
        getRegistry().put("myFilter", new NotificationFilter() {
            public boolean isNotificationEnabled(Notification aNotification) {
                // only accept even notifications
                boolean enabled = aNotification.getSequenceNumber() % 2 == 0;
                if (!enabled) {
                    mRejected.add(aNotification);
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

     * 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

        // register the bean
        mMonitorObjectName = new ObjectName(ep.getObjectDomain(), "name", "camel-jmx-monitor-" + UUID.randomUUID());
        ManagementFactory.getPlatformMBeanServer().registerMBean(bean, mMonitorObjectName);
       
        // add ourselves as a listener to it
        NotificationFilter nf = ep.getNotificationFilter();
        getServerConnection().addNotificationListener(mMonitorObjectName, this, nf, bean);
        bean.start();
    }
View Full Code Here

        // register the NotificationListener
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=eventnotifiers,name=JmxEventNotifier");
        MyNotificationListener listener = new MyNotificationListener();  
        context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,
            listener,                                                                                        
            new NotificationFilter() {           
                private static final long serialVersionUID = 1L;

                public boolean isNotificationEnabled(Notification notification) {
                    return notification.getSource().equals("MyCamel");
                }
View Full Code Here

    public void testExchangeFailed() throws Exception {
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=eventnotifiers,name=JmxEventNotifier");
       
        MyNotificationListener listener = new MyNotificationListener();  
        context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,
            listener, new NotificationFilter() {
                private static final long serialVersionUID = 1L;

                public boolean isNotificationEnabled(Notification notification) {
                    return true;
                }
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.