/** * Bypass the distribution manager and ask the membership manager directly if a given member is * still in the view. * * We need this because we're asking membership questions from within listeners, and we don't know * whether the DM's membership listener fires before or after our own. * * @param id member we are asking about * @return true if we are still in the JGroups view (must return false if id == null) */ protected boolean stillInView(ProfileId id) { if (id instanceof InternalDistributedMember) { InternalDistributedMember memberId = (InternalDistributedMember) id; return this.getDistributionManager().getViewMembers().contains(memberId); } else { // if id is not a InternalDistributedMember then return false return false; } }
/** * Returns a set of the members this advisor should distribute to by default * * @since GemFire 5.7 */ @SuppressWarnings("unchecked") protected Set<InternalDistributedMember> getDefaultDistributionMembers() { if (!useAdminMembersForDefault()) { return getDistributionManager().getOtherDistributionManagerIds(); } else { return getDistributionManager().getAllOtherMembers(); } }
/** * Return true if the memberId on the specified Profile is a current member of the distributed * system. * * @since GemFire 5.7 */ protected boolean isCurrentMember(Profile p) { return getDistributionManager().isCurrentMember(p.getDistributedMember()); }
protected void initialize() { subInit(); getDistributionManager().addMembershipListener(this.ml); }
/** * Free up resources used by this advisor once it is no longer being used. * * @since GemFire 3.5 */ public void close() { try { synchronized (this) { this.membershipClosed = true; operationMonitor.close(); } getDistributionManager().removeMembershipListener(this.ml); } catch (CancelException e) { // if distribution has stopped, above is a no-op. } catch (IllegalArgumentException ignore) { // this is thrown if the listener is no longer registered } }
/** * wait for the current operations being sent on views prior to the joining of the given member * to be placed on communication channels before returning * * @since GemFire 5.1 */ void waitForCurrentOperations() { long timeout = 1000L * distributionAdvisor.getDistributionManager().getSystem().getConfig() .getAckWaitThreshold(); waitForCurrentOperations(logger, timeout, timeout * 2L); }
/** Creates the current distribution profile for this member */ public Profile createProfile() { Profile newProfile = instantiateProfile(getDistributionManager().getId(), incrementAndGetVersion()); getAdvisee().fillInProfile(newProfile); return newProfile; }