- 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);
 | 
					                        String url = (String) urls.elementAt(i);
 | 
				
			||||||
                        IReplicationListener listener = (IReplicationListener) Naming.lookup(url);
 | 
					                        IReplicationListener listener = (IReplicationListener) Naming.lookup(url);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        if (listener == null) {
 | 
				
			||||||
 | 
					                            throw new NullPointerException("Replication listener not bound for URL "+url);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        listener.replicateCache(currentAdd, currentDelete);
 | 
					                        listener.replicateCache(currentAdd, currentDelete);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if (nmgr.logReplication) {
 | 
					                        if (nmgr.logReplication) {
 | 
				
			||||||
                            nmgr.app.logEvent("Sent cache replication event: " +
 | 
					                            nmgr.app.logEvent("Sent cache replication event: " +
 | 
				
			||||||
                                              add.size() + " added, " + delete.size() +
 | 
					                                              currentAdd.size() + " added, " + currentDelete.size() +
 | 
				
			||||||
                                              " deleted");
 | 
					                                              " deleted");
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    } catch (Exception x) {
 | 
					                    } catch (Exception x) {
 | 
				
			||||||
                        nmgr.app.logEvent("Error sending cache replication event: " + x);
 | 
					                        nmgr.app.logEvent("Error sending cache replication event: " + x);
 | 
				
			||||||
 | 
					                        if (nmgr.app.debug()) {
 | 
				
			||||||
 | 
					                            x.printStackTrace();
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue