- Check listener for null before trying to use it in order to get a better error message
- Print out proper number of exchanged objects when logging replication
- Print stack trace if debug is set to true
This commit is contained in:
hns 2003-07-04 11:37:51 +00:00
parent 1f860b5fbf
commit 77f84e9162

View file

@ -69,15 +69,22 @@ public class Replicator implements Runnable {
String url = (String) urls.elementAt(i);
IReplicationListener listener = (IReplicationListener) Naming.lookup(url);
if (listener == null) {
throw new NullPointerException("Replication listener not bound for URL "+url);
}
listener.replicateCache(currentAdd, currentDelete);
if (nmgr.logReplication) {
nmgr.app.logEvent("Sent cache replication event: " +
add.size() + " added, " + delete.size() +
currentAdd.size() + " added, " + currentDelete.size() +
" deleted");
}
} catch (Exception x) {
nmgr.app.logEvent("Error sending cache replication event: " + x);
if (nmgr.app.debug()) {
x.printStackTrace();
}
}
}
}