Revisions:
20020816 Adrian Brock:
2728293031323334
private static final QName NOTIFICATION_ID_QNAME = new QName("", NOTIFICATION_ID); protected void onSerialize(SerializationContext context, Notification notification) throws IOException { super.onSerialize(context, notification); TimerNotification serverNotification = (TimerNotification)notification; context.serialize(NOTIFICATION_ID_QNAME, null, serverNotification.getNotificationID()); }
844845846847848849850851852853
// public void compareTimerNotification(Object o1, Object o2) { compareNotification(o1, o2); TimerNotification n1 = (TimerNotification)o1; TimerNotification n2 = (TimerNotification)o2; if (!n1.getNotificationID().equals(n2.getNotificationID())) throw new RuntimeException(); }
118119120121122123124125
list); sendNotification(n); } public void triggerTimerNotification() { TimerNotification n = new TimerNotification("timer.notification", this, mSequence++, mTimestamp, "timer-notification", 100); sendNotification(n); }
126127128129130131132133
492493494495496497498499500501502503504
{ seq = ++sequenceNumber; } log.debug("sendNotification: " + rn); TimerNotification tn = new TimerNotification(rn.type, objectName, seq, rn.nextDate, rn.message, rn.id); tn.setUserData(rn.userData); sendNotification(tn); } // Calculate the next date. // Except for when we are sending past notifications at start up, // it cannot be in the future.
209210211212213214215216217218219220
* 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(); } }
344345346347348349350351352353354355356
/* */ { /* 493 */ seq = ++this.sequenceNumber; /* */ } /* */ /* 496 */ log.debug("sendNotification: " + rn); /* 497 */ TimerNotification tn = new TimerNotification(rn.type, this.objectName, seq, rn.nextDate, rn.message, rn.id); /* */ /* 499 */ tn.setUserData(rn.userData); /* 500 */ sendNotification(tn); /* */ } /* */ /* */ do /* */ {