}
public void addNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)
throws InstanceNotFoundException, IOException
{
NotificationTuple tuple = new NotificationTuple(observed, listener, filter, handback);
if (notificationHandler.contains(tuple)) return;
MarshalledObject f = null;
try
{
f = RMIMarshaller.marshal(filter);
}
catch (NotSerializableException x)
{
// Invoke the filter on client side
tuple.setInvokeFilter(true);
}
Integer[] ids = connection.addNotificationListeners(new ObjectName[] {observed}, new MarshalledObject[] {f}, new Subject[] {delegate});
notificationHandler.addNotificationListener(ids[0], tuple);
}