Package javax.management.timer

Examples of javax.management.timer.TimerNotification


       */
      public boolean isNotificationEnabled(Notification pNotification)
      {
         if (!(pNotification instanceof TimerNotification))
      return false;
     TimerNotification lTimerNotification = (TimerNotification) pNotification;
     if (log.isTraceEnabled())
      log.trace("isNotificationEnabled(), filterId=" + filterId +
         ", notification=" + pNotification +
         ", notificationId=" + lTimerNotification.getNotificationID() +
         ", timestamp=" + lTimerNotification.getTimeStamp() +
         ", message=" + lTimerNotification.getMessage()
      );
     return lTimerNotification.getNotificationID().equals(filterId);
      }
View Full Code Here


    * Handle the notification, just add it to the list
    */
   public void handleNotification(Notification n, Object ignored)
   {
      notifications++;
      TimerNotification tn = (TimerNotification) n;
      if (timer.getNbOccurences(tn.getNotificationID()).longValue() == 1)
         synchronized(timerName)
         {
            timerName.notifyAll();
         }
   }
View Full Code Here

         sync();
         stopTimer();
         long endTime = timeOffset(0).getTime();

         assertEquals(1, notifications.size());
         TimerNotification tn = (TimerNotification) notifications.get(0);
         assertEquals(MESSAGE, tn.getMessage());
         assertEquals(1, tn.getSequenceNumber());
         assertEquals(timerName, tn.getSource());
         assertEquals(TIMER_TYPE, tn.getType());
         assertEquals(USER_DATA, tn.getUserData());
         assertEquals(id, tn.getNotificationID());
         if (tn.getTimeStamp() < startTime + TimerSUITE.ZERO_TIME)
           fail("Timer notification before start?");
         if (tn.getTimeStamp() > endTime)
           fail("Timer notification after end?");
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
View Full Code Here

                                           lTimeTwo, 0);
        
         expectNotifications( 1, lWait );
         expectNotifications( 2, lWait );
         // Check time differences which should be around TIME ONE
         TimerNotification lNotificationOne = (TimerNotification) receivedNotifications.get( 0 );
         TimerNotification lNotificationTwo = (TimerNotification) receivedNotifications.get( 1 );
         checkNotificationID( lNotificationOne, lIdOne );
         checkNotificationID( lNotificationTwo, lIdOne );
         checkTimeDifference( lNotificationOne, lNotificationTwo, lTimeOne );
        
         expectNotifications( 3, lWait );
View Full Code Here

       */
      public boolean isNotificationEnabled(Notification pNotification)
      {
         if (!(pNotification instanceof TimerNotification))
      return false;
     TimerNotification lTimerNotification = (TimerNotification) pNotification;
     if (log.isTraceEnabled())
      log.trace("isNotificationEnabled(), filterId=" + filterId +
         ", notification=" + pNotification +
         ", notificationId=" + lTimerNotification.getNotificationID() +
         ", timestamp=" + lTimerNotification.getTimeStamp() +
         ", message=" + lTimerNotification.getMessage()
      );
     return lTimerNotification.getNotificationID().equals(filterId);
      }
View Full Code Here

         sync();
         stopTimer();
         long endTime = timeOffset(0).getTime();

         assertEquals(1, notifications.size());
         TimerNotification tn = (TimerNotification) notifications.get(0);
         assertEquals(MESSAGE, tn.getMessage());
         assertEquals(1, tn.getSequenceNumber());
         assertEquals(timerName, tn.getSource());
         assertEquals(TIMER_TYPE, tn.getType());
         assertEquals(USER_DATA, tn.getUserData());
         assertEquals(id, tn.getNotificationID());
         if (tn.getTimeStamp() < startTime + TimerSUITE.ZERO_TIME)
           fail("Timer notification before start?");
         if (tn.getTimeStamp() > endTime)
           fail("Timer notification after end?");
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
View Full Code Here

                                           lTimeTwo, 0);
        
         expectNotifications( 1, lWait );
         expectNotifications( 2, lWait );
         // Check time differences which should be around TIME ONE
         TimerNotification lNotificationOne = (TimerNotification) receivedNotifications.get( 0 );
         TimerNotification lNotificationTwo = (TimerNotification) receivedNotifications.get( 1 );
         checkNotificationID( lNotificationOne, lIdOne );
         checkNotificationID( lNotificationTwo, lIdOne );
         checkTimeDifference( lNotificationOne, lNotificationTwo, lTimeOne );
        
         expectNotifications( 3, lWait );
View Full Code Here

                                           lTimeTwo, 0);
        
         expectNotifications( 1, lWait );
         expectNotifications( 2, lWait );
         // Check time differences which should be around TIME ONE
         TimerNotification lNotificationOne = (TimerNotification) receivedNotifications.get( 0 );
         TimerNotification lNotificationTwo = (TimerNotification) receivedNotifications.get( 1 );
         checkNotificationID( lNotificationOne, lIdOne );
         checkNotificationID( lNotificationTwo, lIdOne );
         checkTimeDifference( lNotificationOne, lNotificationTwo, lTimeOne );
        
         expectNotifications( 3, lWait );
View Full Code Here

                list);
        sendNotification(n);
    }

    public void triggerTimerNotification() {
        TimerNotification n = new TimerNotification("timer.notification", this, mSequence++, mTimestamp, "timer-notification", 100);
        sendNotification(n);
    }
View Full Code Here

      if (TimerNotificationSer.NOTIFICATION_ID.equals(hint)) notificationID = (Integer)value;
   }

   protected Object createObject() throws SAXException
   {
      TimerNotification notification = new TimerNotification(getType(), getSource(), getSequenceNumber(), getTimeStamp(), getMessage(), notificationID);
      return notification;
   }
View Full Code Here

TOP

Related Classes of javax.management.timer.TimerNotification

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.