Examples of fetchNotifications()


Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        NotificationFilterSupport regFilter = new NotificationFilterSupport();
        regFilter.enableType(notifType);

        // Get initial sequence number
        NotificationResult nr =
            nb.fetchNotifications(allListenerFilter, 0, 0L, 0);
        int nnotifs = nr.getTargetedNotifications().length;
        if (nnotifs > 0) {
            System.out.println("Expected 0 notifs for initial fetch, " +
                               "got " + nnotifs);
            return false;
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

            return false;
        }
        System.out.println("Notification sender has 1 listener, OK");

        // Now we should see two creation notifications
        nr = nb.fetchNotifications(allListenerFilter, next, 0L,
                                   Integer.MAX_VALUE);
        TargetedNotification[] tns = nr.getTargetedNotifications();
        if (tns.length != 2) {
            System.out.println("Expected 2 notifs, got: " +
                               Arrays.asList(tns));
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

            return false;
        }
        System.out.println("Got 2 different MBeanServerNotifications, OK");

        // If we ask for max 1 notifs, we should only get one
        nr = nb.fetchNotifications(allListenerFilter, next, 0L, 1);
        tns = nr.getTargetedNotifications();
        if (tns.length != 1) {
            System.out.println("Expected 1 notif, got: " + Arrays.asList(tns));
            return false;
        }
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        }
        TargetedNotification tn1 = tns[0];
        System.out.println("Got 1 notif when asked for 1, OK");

        // Now we should get the other one
        nr = nb.fetchNotifications(allListenerFilter, nr.getNextSequenceNumber(),
                                   0L, 1);
        tns = nr.getTargetedNotifications();
        if (tns.length != 1) {
            System.out.println("Expected 1 notif, got: " + Arrays.asList(tns));
            return false;
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        }
        System.out.println("2 creation notifs are different, OK");

        // Now we should get none (timeout is 0)
        long oldNext = nr.getNextSequenceNumber();
        nr = nb.fetchNotifications(allListenerFilter, oldNext, 0L,
                                   Integer.MAX_VALUE);
        tns = nr.getTargetedNotifications();
        if (tns.length != 0) {
            System.out.println("Expected 0 notifs, got: " +
                               Arrays.asList(tns));
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        }
        System.out.println("Next seqno unchanged with 0 timeout, OK");

        // Check that timeouts work
        long startTime = System.currentTimeMillis();
        nr = nb.fetchNotifications(allListenerFilter, oldNext, 250L,
                                   Integer.MAX_VALUE);
        tns = nr.getTargetedNotifications();
        if (tns.length != 0) {
            System.out.println("Expected 0 notifs, got: " +
                               Arrays.asList(tns));
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

            }
        };
        Integer senderListenerId = new Integer(88);
        NotificationBufferFilter senderListenerFilter =
                makeFilter(senderListenerId, wildcardName, senderFilter);
        nr = nb.fetchNotifications(senderListenerFilter, 0, 1000L,
                                   Integer.MAX_VALUE);
        tns = nr.getTargetedNotifications();
        if (tns.length != 1) {
            System.out.println("Expected 1 notif, got: " + Arrays.asList(tns));
            return false;
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        }
        System.out.println("Successfully applied NotificationFilter, OK");

        // Now send 8 notifs to fill up our 10-element buffer
        sender.sendNotifs("tiddly.pom", 8);
        nr = nb.fetchNotifications(allListenerFilter, 0, 1000L,
                                   Integer.MAX_VALUE);
        tns = nr.getTargetedNotifications();
        if (tns.length != 10) {
            System.out.println("Expected 10 notifs, got: " +
                               Arrays.asList(tns));
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        System.out.println("Notifs have right types, OK");

        // Check that ObjectName filtering works
        NotificationBufferFilter senderNameFilter =
                makeFilter(new Integer(66), senderName, null);
        nr = nb.fetchNotifications(senderNameFilter, 0, 0L,
                                   Integer.MAX_VALUE);
        tns = nr.getTargetedNotifications();
        if (tns.length != 8) {
            System.out.println("Bad result from ObjectName filtering: " +
                               Arrays.asList(tns));
View Full Code Here

Examples of com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications()

        }
        System.out.println("ObjectName filtering works, OK");

        // Send one more notif, which should cause the oldest one to drop
        sender.sendNotifs("foo.bar", 1);
        nr = nb.fetchNotifications(allListenerFilter, 0, 1000L,
                                   Integer.MAX_VALUE);
        if (nr.getEarliestSequenceNumber() <= earliest) {
            System.out.println("Expected earliest to increase: " +
                               nr.getEarliestSequenceNumber() + " should be > "
                               + earliest);
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.