private synchronized int associate(ObjectName target, NotificationListener listener, NotificationFilter filter, Object handBack) { Integer next = getNextNotificationId(); // Not likely but possible to use all IDs and start back at beginning while // old request still in progress. while (listeners.containsKey(next)) { next = getNextNotificationId(); } Association association = new Association(); association.target = target; association.listener = listener; association.filter = filter; association.handBack = handBack; listeners.put(next, association); return next; }
private synchronized int associate(ObjectName target, NotificationListener listener, NotificationFilter filter, Object handBack) { Integer next = getNextNotificationId(); // Not likely but possible to use all IDs and start back at beginning while // old request still in progress. while (listeners.containsKey(next)) { next = getNextNotificationId(); } Association association = new Association(); association.target = target; association.listener = listener; association.filter = filter; association.handBack = handBack; listeners.put(next, association); return next; }
private synchronized int associate(ObjectName target, NotificationListener listener, NotificationFilter filter, Object handBack) { Integer next = getNextNotificationId(); // Not likely but possible to use all IDs and start back at beginning while // old request still in progress. while (listeners.containsKey(next)) { next = getNextNotificationId(); } Association association = new Association(); association.target = target; association.listener = listener; association.filter = filter; association.handBack = handBack; listeners.put(next, association); return next; }