/** * This method is called whenever the observed object is changed. An application calls an <tt>Observable</tt> object's <code>notifyObservers</code> method to have all the object's observers notified of the change. default implementation is to * cause the courier service to deliver to the interface controlled by my controller. Extensions can override. * * @param o * the observable object. * @param arg * an argument passed to the <code>notifyObservers</code> method. */ public void update(Observable o, Object arg) { // arg is Event if (!(arg instanceof Event)) return; Event event = (Event) arg; // check the event function against the functions we have notifications watching for String function = event.getEvent(); // for each notification watching for this event List notifications = getNotifications(function); for (Iterator it = notifications.iterator(); it.hasNext();) { Notification notification = (Notification) it.next(); // if the resource matches the notification's resource filter if (match(notification.getResourceFilter(), event.getResource())) { // cause the notification to run notification.notify(event); } } } // update