Update of /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/notification
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8476
Modified Files:
Notifier.java
Log Message:
Use async notifications
Index: Notifier.java
===================================================================
RCS file: /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/notification/Notifier.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Notifier.java 1 Jul 2005 11:30:00 -0000 1.2
--- Notifier.java 17 Aug 2005 10:08:08 -0000 1.3
***************
*** 77,82 ****
while (it.hasNext()) {
NotificationListener l = (NotificationListener)it.next();
! if (l.isNotificationEnabled(n.getType())) {
! l.handleNotification(n);
}
}
--- 77,110 ----
while (it.hasNext()) {
NotificationListener l = (NotificationListener)it.next();
! new NotificationThread(l, n).start();
! }
! }
!
! /**
! * Notification thread
! */
! class NotificationThread extends Thread {
! /** The NotificationListener */
! private NotificationListener listener;
!
! /** The notification */
! private Notification n;
!
! /**
! * Constructor
! * @param listener The notification listener
! * @param n The notification
! */
! NotificationThread(NotificationListener listener, Notification n) {
! this.listener = listener;
! this.n = n;
! }
!
! /**
! * Run
! */
! public void run() {
! if (listener.isNotificationEnabled(n.getType())) {
! listener.handleNotification(n);
}
}
|