Package javax.management

Examples of javax.management.NotificationFilterSupport


            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

        RMIClientSocketFactory rcsf = new SslRMIClientSocketFactory();
        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, rssf);
        env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, rcsf);
       
        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

        }
    }

    private void registerListeners() throws InstanceNotFoundException,
            MalformedObjectNameException, IOException {
        final NotificationFilterSupport filter = new NotificationFilterSupport();
        filter.enableType(StatusLoggerAdminMBean.NOTIF_TYPE_MESSAGE);
        final ObjectName objName = new ObjectName(StatusLoggerAdminMBean.NAME);
        client.getConnection().addNotificationListener(objName, this, filter,
                null);
    }
View Full Code Here

        // which is the MBeanInvocationHandlerImpl and so also a NotificationListener.
        final NotificationListener invocationHandler = (NotificationListener) Proxy.getInvocationHandler(mbsf);

        // Install a notification listener on OPENED, CLOSED, and FAILED,
        // passing the map of connection-ids to usernames as hand-back data.
        final NotificationFilterSupport invocationHandlerFilter = new NotificationFilterSupport();
        invocationHandlerFilter.enableType(JMXConnectionNotification.OPENED);
        invocationHandlerFilter.enableType(JMXConnectionNotification.CLOSED);
        invocationHandlerFilter.enableType(JMXConnectionNotification.FAILED);
        _cs.addNotificationListener(invocationHandler, invocationHandlerFilter, connectionIdUsernameMap);

        // Install a second notification listener on CLOSED AND FAILED only to remove the entry from the
        // Map.  Here we rely on the fact that JMX will call the listeners in the order in which they are
        // installed.
        final NotificationFilterSupport mapCleanupHandlerFilter = new NotificationFilterSupport();
        mapCleanupHandlerFilter.enableType(JMXConnectionNotification.CLOSED);
        mapCleanupHandlerFilter.enableType(JMXConnectionNotification.FAILED);
        _cs.addNotificationListener(mapCleanupListener, mapCleanupHandlerFilter, null);

        _cs.start();

        String connectorServer = (sslEnabled ? "SSL " : "") + "JMX RMIConnectorServer";
View Full Code Here

            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);
        server.start();
        log.debug("Started JMXConnector " + server.getAddress());
    }
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

        // which is the MBeanInvocationHandlerImpl and so also a NotificationListener.
        final NotificationListener invocationHandler = (NotificationListener) Proxy.getInvocationHandler(mbsf);

        // Install a notification listener on OPENED, CLOSED, and FAILED,
        // passing the map of connection-ids to usernames as hand-back data.
        final NotificationFilterSupport invocationHandlerFilter = new NotificationFilterSupport();
        invocationHandlerFilter.enableType(JMXConnectionNotification.OPENED);
        invocationHandlerFilter.enableType(JMXConnectionNotification.CLOSED);
        invocationHandlerFilter.enableType(JMXConnectionNotification.FAILED);
        _cs.addNotificationListener(invocationHandler, invocationHandlerFilter, connectionIdUsernameMap);

        // Install a second notification listener on CLOSED AND FAILED only to remove the entry from the
        // Map.  Here we rely on the fact that JMX will call the listeners in the order in which they are
        // installed.
        final NotificationFilterSupport mapCleanupHandlerFilter = new NotificationFilterSupport();
        mapCleanupHandlerFilter.enableType(JMXConnectionNotification.CLOSED);
        mapCleanupHandlerFilter.enableType(JMXConnectionNotification.FAILED);
        _cs.addNotificationListener(mapCleanupListener, mapCleanupHandlerFilter, null);

        _cs.start();

        String connectorServer = (sslEnabled ? "SSL " : "") + "JMX RMIConnectorServer";
View Full Code Here

            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);
        server.start();
        log.debug("Started JMXConnector " + server.getAddress());
    }
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.