Package javax.management

Examples of javax.management.MBeanServerConnection.addNotificationListener()


       
        // subscribe for a notifications
        TaskStateFilter filter = new TaskStateFilter();
        TestListener listener = new TestListener(filter);   
        MBeanServerConnection mbServerConn = this.jmxConnector.getMBeanServerConnection();
        mbServerConn.addNotificationListener(taskThread, listener, null, null);
       
        Notification notification = null;
       
        // check for task hung notification
        notification = listener.getNotification(TIMEOUT);
View Full Code Here


        assertTrue("Expected eventTypes are missing", expectedEventTypes.isEmpty());
           
        // subscribe for a notification of a new thread
        NewThreadFilter filter = new NewThreadFilter();
        TestListener listener = new TestListener(filter);           
        mbServerConn.addNotificationListener(threadFactory, listener, null, null);
                  
        invokeTest("testStartRunnable");       
        testThreadNotification(threadFactory,
                               listener,
                               "TestRunnable",
View Full Code Here

            mbsc.createMBean(NB.class.getName(), nb3);

            // Add notification listener
            //
            Listener li = new Listener();
            mbsc.addNotificationListener(nb1, li, null, null);
            mbsc.addNotificationListener(nb2, li, null, null);

            // Set security manager
            //
            if (sm) {
View Full Code Here

            // Add notification listener
            //
            Listener li = new Listener();
            mbsc.addNotificationListener(nb1, li, null, null);
            mbsc.addNotificationListener(nb2, li, null, null);

            // Set security manager
            //
            if (sm) {
                echo("Setting SM");
View Full Code Here

                System.exit(1);
            }
            // Add notification listener on SimpleStandard MBean
            //
            System.out.println("Add notification listener...");
            mbsc.addNotificationListener(
                 new ObjectName("MBeans:name=SimpleStandard"),
                 new NotificationListener() {
                     public void handleNotification(Notification notification,
                                                    Object handback) {
                         System.out.println("Received notification: " +
View Full Code Here

        final ObjectName mbean = ObjectName.getInstance(":type=Simple");
        mbsc.createMBean(Simple.class.getName(), mbean);

        System.out.println("EmptyDomainNotificationTest-main: add a listener ...");
        final Listener li = new Listener();
        mbsc.addNotificationListener(mbean, li, null, null);

        System.out.println("EmptyDomainNotificationTest-main: ask to send a notif ...");
        mbsc.invoke(mbean, "emitNotification", null, null);

        System.out.println("EmptyDomainNotificationTest-main: waiting notif...");
View Full Code Here

                System.exit(1);
            }
            // Add notification listener on SimpleStandard MBean
            //
            System.out.println("Add notification listener...");
            mbsc.addNotificationListener(
                 new ObjectName("MBeans:name=SimpleStandard"),
                 new NotificationListener() {
                     public void handleNotification(Notification notification,
                                                    Object handback) {
                         System.out.println("Received notification: " +
View Full Code Here

                System.out.println("Idle Time: " + elapsed + "ms");

                for (i=0; i<countListeners.length; i++) {
                    System.out.println("add " + countListeners[i] +
                                       ": starting at " + elapsed + "ms");
                    conn.addNotificationListener(delegateName,
                                                 countListeners[i],
                                                 null,null);
                }

                System.out.println("connId=" + connId);
View Full Code Here

            // Add notification listener
            //
            Listener li = new Listener();
            try {
                mbsc.addNotificationListener(nb1, li, null, null);
                if (enableChecks && throwException) {
                    echo("Didn't get expected exception");
                    return 1;
                }
            } catch (SecurityException e) {
View Full Code Here

                } else {
                    echo("Got unexpected exception: " + e);
                    return 1;
                }
            }
            mbsc.addNotificationListener(nb2, li, null, null);

            // Invoke the "sendNotification" method
            //
            mbsc.invoke(nb1, "emitNotification",
                new Object[] {0, null},
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.