return all;
}
}
protected BusListenerInfo createBusListenerInfo() {
BusListenerInfo bii = new BusListenerInfo();
synchronized(infocenter) { // o_clusterOK by:fj: extract quickly so that we can later serialize and send across the wire. data affects only one vm.
// for all types: the name of the type + "::"+ the id (integer) is used as key
for (Entry<String, EventAgency> entry: infocenter.entrySet()) {
String derivedOres = entry.getKey();
int cnt = entry.getValue().getListenerCount();
// only add those with at least one current listener. Telling that a resource has no listeners is unneeded since we update
// the whole table on each clusterInfoEvent (cluster:: could be improved by only sending the delta of listeners)
if (cnt > 0) bii.addEntry(derivedOres, cnt);
}
// for all types: the name of the type is used as key
for (Entry<String, EventAgency> entry: typeInfocenter.entrySet()) {
String derivedOres = entry.getKey();
int cnt = entry.getValue().getListenerCount();
if (cnt > 0) bii.addEntry(derivedOres, cnt);
}
}
return bii;
}