Package javax.management.timer

Examples of javax.management.timer.TimerMBean.addNotification()


// FIXME FIXME FIXME FIXME        
//         if (!server.isRegistered(timerName))
//            timer.start();
        
         timer.addNotification(
            "persistence.timer.notification",
            null,                                  // msg
            name,                                  // userData
            new Date(System.currentTimeMillis())// timestamp
            persistPeriod
View Full Code Here


         // calculate all times from now
         startTime = System.currentTimeMillis();
        
         // This must cause a fixed-delay timer notification production
         // with TIMES notification produced, spaced at PERIOD msecs, starting in now+PERIOD
         timer.addNotification("timer.notification", null, null, new Date(startTime + PERIOD), PERIOD, TIMES);
        
         long expectedDuration = FIXED_DELAY_TOTAL;         
         waitForNotifications(TIMES, expectedDuration * 2);
        
         long testDuration = System.currentTimeMillis() - startTime;
View Full Code Here

         // calculate all times from now
         startTime = System.currentTimeMillis();
        
         // This must cause a fixed-rate timer notification production
         // with TIMES notification produced, spaced at PERIOD msecs, starting in now+PERIOD
         timer.addNotification("timer.notification", null, null, new Date(startTime + PERIOD), PERIOD, TIMES, true);
        
         long expectedDuration = FIXED_RATE_TOTAL;           
         waitForNotifications(TIMES, expectedDuration * 2);
        
         long testDuration = System.currentTimeMillis() - startTime;
View Full Code Here

            MBeanServerInvocationHandler.newProxyInstance(mbs,
                                                          timerName,
                                                          TimerMBean.class,
                                                          false);
        Date doomsday = new Date(Long.MAX_VALUE);
        int timer1 = timer.addNotification("one", "one", null, doomsday);
        int timer2 = timer.addNotification("two", "two", null, doomsday);
        Vector<Integer> idsOne = timer.getNotificationIDs("one");
        check("Vector<Integer> TimerMBean.getNotificationIDs",
              idsOne.equals(singletonList(timer1)));
        Vector<Integer> allIds = timer.getAllNotificationIDs();
View Full Code Here

                                                          timerName,
                                                          TimerMBean.class,
                                                          false);
        Date doomsday = new Date(Long.MAX_VALUE);
        int timer1 = timer.addNotification("one", "one", null, doomsday);
        int timer2 = timer.addNotification("two", "two", null, doomsday);
        Vector<Integer> idsOne = timer.getNotificationIDs("one");
        check("Vector<Integer> TimerMBean.getNotificationIDs",
              idsOne.equals(singletonList(timer1)));
        Vector<Integer> allIds = timer.getAllNotificationIDs();
        check("Vector<Integer> TimerMBean.getAllNotificationIDs",
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.