Index: src/java/com/sun/enterprise/jxtamgmt/ClusterViewManager.java =================================================================== RCS file: /cvs/shoal/gms/src/java/com/sun/enterprise/jxtamgmt/ClusterViewManager.java,v retrieving revision 1.25 diff -u -a -r1.25 ClusterViewManager.java --- src/java/com/sun/enterprise/jxtamgmt/ClusterViewManager.java 30 Jul 2009 18:15:46 -0000 1.25 +++ src/java/com/sun/enterprise/jxtamgmt/ClusterViewManager.java 5 Jan 2010 21:57:02 -0000 @@ -130,6 +130,14 @@ } finally { viewLock.unlock(); } + if (result) { + boolean added = manager.getHealthMonitor().addHealthEntryIfMissing(advertisement); + if (added) { + if (LOG.isLoggable(Level.INFO)) { + LOG.log(Level.INFO, "ensured ClusterViewManager and HealthMonitor both aware of member: " + advertisement.getName()); + } + } + } return result; } @@ -427,6 +435,12 @@ .toString() ); if( !changed && !view.containsKey( elem.getID().toString() ) ) { changed = true; + boolean added = manager.getHealthMonitor().addHealthEntryIfMissing(advertisement); + if (added) { + if (LOG.isLoggable(Level.INFO)) { + LOG.log(Level.INFO, "ensured ClusterViewManager and HealthMonitor both aware of member: " + advertisement.getName()); + } + } } // Always add the wire version of the adv view.put( elem.getID().toString(), elem ); Index: src/java/com/sun/enterprise/jxtamgmt/HealthMonitor.java =================================================================== RCS file: /cvs/shoal/gms/src/java/com/sun/enterprise/jxtamgmt/HealthMonitor.java,v retrieving revision 1.95 diff -u -a -r1.95 HealthMonitor.java --- src/java/com/sun/enterprise/jxtamgmt/HealthMonitor.java 7 Aug 2009 19:10:35 -0000 1.95 +++ src/java/com/sun/enterprise/jxtamgmt/HealthMonitor.java 5 Jan 2010 21:57:02 -0000 @@ -270,6 +270,21 @@ return msg; } + public boolean addHealthEntryIfMissing(final SystemAdvertisement adv) { + final ID id = adv.getID(); + synchronized(cacheLock) { + HealthMessage.Entry entry = cache.get(id); + if (entry == null) { + final long BEFORE_FIRST_HEALTHMESSAGE_SEQ_ID = 0; + entry = new HealthMessage.Entry(adv, states[STARTING], BEFORE_FIRST_HEALTHMESSAGE_SEQ_ID); + cache.put((PeerID) id, entry); + return true; + } else { + return false; + } + } + } + // Fix for glassfish issue 9055 // This method is used by master to send a healthmessage reporting another peers state. // use entry and its entry.seqID that is already in cache.