if(matchInfo == null) {
beans.addAll(table.values());
} else {
Iterator i = table.values().iterator();
while(i.hasNext()) {
RMBean candidate = (RMBean)i.next();
if(candidate.match(matchInfo)) {
beans.add(candidate);
}
}
}
}
// Now we have a point-in-time view of the beans, lock them all
Iterator i = beans.iterator();
while(i.hasNext()) mgr.enlistBean((RMBean) i.next());
// Finally remove any beans that are no longer in the table
synchronized (table) {
i = beans.iterator();
while(i.hasNext()) {
RMBean bean = (RMBean) i.next();
if(!table.containsValue(bean)) {
i.remove();
}
}
}