1 package mx4j.remote.rmi; 2 3 import java.util.Map ; 4 import java.util.ArrayList ; 5 6 import javax.management.remote.TargetedNotification ; 7 8 import mx4j.remote.DefaultRemoteNotificationServerHandler; 9 import mx4j.remote.MX4JRemoteUtils; 10 import mx4j.log.Logger; 11 12 16 class RMIRemoteNotificationServerHandler extends DefaultRemoteNotificationServerHandler 17 { 18 RMIRemoteNotificationServerHandler(Map environment) 19 { 20 super(environment); 21 } 22 23 protected TargetedNotification [] filterNotifications(TargetedNotification [] notifications) 24 { 25 Logger logger = null; 26 ArrayList list = new ArrayList (); 27 for (int i = 0; i < notifications.length; ++i) 28 { 29 TargetedNotification notification = notifications[i]; 30 if (MX4JRemoteUtils.isTrulySerializable(notification)) 31 { 32 list.add(notification); 33 } 34 else 35 { 36 if (logger == null) logger = getLogger(); 37 if (logger.isEnabledFor(Logger.INFO)) logger.info("Cannot send notification " + notification + " to the client: it is not serializable"); 38 } 39 } 40 return (TargetedNotification [])list.toArray(new TargetedNotification [list.size()]); 41 } 42 } 43 | Popular Tags |