public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { TargetedNotification targetedNotification = (TargetedNotification)value; context.startElement(name, attributes); context.serialize(NOTIFICATION_QNAME, null, targetedNotification.getNotification()); context.serialize(LISTENER_ID_QNAME, null, targetedNotification.getListenerID()); context.endElement(); }
/** * @param tn . * @param myListenerID . * @param listeners . */ void dispatchNotification(final TargetedNotification tn, final Integer myListenerID, final Map<Integer, ListenerInfo> listeners) { final Notification notif = tn.getNotification(); final Integer listenerID = tn.getListenerID(); if (listenerID.equals(myListenerID)) return; final ListenerInfo li = listeners.get(listenerID); if (li == null) { logger.trace("NotifFetcher.dispatch", "Listener ID not in map"); return; } final NotificationListener l = li.getListener(); final Object h = li.getHandback(); try { l.handleNotification(notif, h); } catch (final RuntimeException e) { final String msg = "Failed to forward a notification " + "to a listener"; logger.trace("NotifFetcher-run", msg, e); } }
for (int i = 0; i < len; i++) { final TargetedNotification tn = notifs[i]; final Integer listenerID = tn.getListenerID(); if (!listenerID.equals(forwarder.mbeanRemovedNotifID)) { // check if an mbean unregistration notif final ListenerInfo li = forwarder.infoList.get(listenerID);
Integer id = targetedNotification.getListenerID(); ClientListenerHolder holder = (ClientListenerHolder)clientListeners.get(id); if(holder != null)
logger.warning("purgeUnserializable", "cannot serialize notif: " + tn); logger.fine("purgeUnserializable", e); final Integer listenerID = tn.getListenerID(); final Notification badNotif = tn.getNotification(); final String notifType = JMXConnectionNotification.NOTIFS_LOST;
synchronized (tuples) tuple = (NotificationTuple)tuples.get(notification.getListenerID());