public DistributionManager getDistributionManager() { return getAdvisee().getDistributionManager(); }
/** * Like getDistributionManager but does not check * that the DistributedSystem is still connected */ private DistributionManager getDistributionManagerWithNoCheck() { return getAdvisee().getSystem().getDM(); }
/** * Dumps out all profiles in this advisor. * * @param infoMsg prefix message to log */ public void dumpProfiles(String infoMsg) { Profile[] profs = this.profiles; final StringBuffer buf = new StringBuffer(2000); if (infoMsg != null) { buf.append(infoMsg); buf.append(": "); } buf.append("FYI, DUMPING PROFILES IN "); buf.append(toString()); buf.append(":\n"); buf.append("My Profile="); buf.append(getAdvisee().getProfile()); buf.append("\nOther Profiles:\n"); for (int i = 0; i < profs.length; i++) { buf.append("\t"); buf.append(profs[i].toString()); buf.append("\n"); } if (logger.isDebugEnabled()) { logger.debug(buf.toString()); } }
/** * Removes the profile for the specified member and serial number * * @param memberId the member to remove the profile for * @param serialNum specific serial number to remove * @return true if a matching profile for the member was found */ public boolean removeIdWithSerial(InternalDistributedMember memberId, int serialNum, boolean regionDestroyed) { if (logger.isTraceEnabled(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE)) { logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "removeIdWithSerial: removing member {} with serial {} from resource {}", memberId, serialNum, getAdvisee().getName()); } Assert.assertTrue(serialNum != ILLEGAL_SERIAL); return updateRemovedProfiles(memberId, serialNum, regionDestroyed); }
logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "updateRemovedProfiles: ensure member {} with serial {} is removed from region {}", memberId, serialNum, getAdvisee().getFullPath());
/** exchange profiles to initialize this advisor */ public void exchangeProfiles() { Assert.assertHoldsLock(this, false); // causes deadlock Assert.assertHoldsLock(this.initializeLock, true); new UpdateAttributesProcessor(getAdvisee()).distribute(true); setInitialized(); }
/** Creates the current distribution profile for this member */ public Profile createProfile() { Profile newProfile = instantiateProfile(getDistributionManager().getId(), incrementAndGetVersion()); getAdvisee().fillInProfile(newProfile); return newProfile; }
if (isDebugEnabled_DA) { logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "removeId: removing member {} from resource {}", memberId, getAdvisee().getFullPath());
logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "putProfile: ignoring {}; not in current view for {}", newProfile.getDistributedMember(), getAdvisee().getFullPath()); logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "putProfile: Skipping putProfile: {} is not newer than serialNumber {} for {}", newProfile, removedSerialNumber, getAdvisee().getFullPath()); logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "putProfile: Updating existing profile: {} with new profile: {} for {}", oldProfile, newProfile, getAdvisee().getFullPath()); logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE, "putProfile: Ignoring {} because it's older than or same as {} for {}", newProfile, oldProfile, getAdvisee().getFullPath());
/** * Provide recipients for profile exchange, called by UpdateAttributesProcessor and * CreateRegionProcessor. Can not be initialized at this point because it is only called in the * following scenarios: 1) We're doing a lazy initialization and synchronization on initializeLock * prevents other threads from causing initialization on this advisor. 2) We're creating a new * region and doing profile exchange as part of region initialization, in which case no other * threads have access to the region or this advisor. */ public Set adviseProfileExchange() { // Get the list of recipients from the nearest initialized advisor // in the parent chain Assert.assertTrue(!isInitialized()); DistributionAdvisor advisor; DistributionAdvisee advisee = getAdvisee(); do { advisee = advisee.getParentAdvisee(); if (advisee == null) return getDefaultDistributionMembers(); advisor = advisee.getDistributionAdvisor(); } while (!advisor.isInitialized()); // do not call adviseGeneric because we don't want to trigger another // profile exchange on the parent return advisor.adviseFilter(null); }