- 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:
parent
1f860b5fbf
commit
77f84e9162
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue