DistributionAdvisor { public void syncForCrashedMember(final InternalDistributedMember id, final Profile profile) { final DistributedRegion dr = getRegionForDeltaGII(); if (dr == null) { return; } final boolean isDebugEnabled = logger.isDebugEnabled(); if (isDebugEnabled) { logger.debug("da.syncForCrashedMember will sync region in cache's timer for region: {}", dr); } CacheProfile cacheProfile = (CacheProfile) profile; PersistentMemberID persistentId = getPersistentID(cacheProfile); VersionSource lostVersionID; if (persistentId != null) { lostVersionID = persistentId.getVersionMember(); } else { lostVersionID = id; } final long delay = getDelay(dr); if (dr.getDataPolicy().withPersistence() && persistentId == null) { if (logger.isDebugEnabled()) { logger.debug( "da.syncForCrashedMember skipping sync because crashed member is not persistent: {}", id); } return; } dr.scheduleSynchronizeForLostMember(id, lostVersionID, delay); if (dr.getConcurrencyChecksEnabled()) { dr.setRegionSynchronizeScheduled(lostVersionID); } } protected  DistributionAdvisor(DistributionAdvisee advisee); boolean shouldSyncForCrashedMember(InternalDistributedMember id); void syncForCrashedMember(final InternalDistributedMember id, final Profile profile); DistributedRegion getRegionForDeltaGII(); static int createSerialNumber(); DistributionManager getDistributionManager(); DistributionAdvisee getAdvisee(); void close(); Set<InternalDistributedMember> addMembershipListenerAndAdviseGeneric(
      MembershipListener listener); void addMembershipListener(MembershipListener listener); void setInitializationListener(InitializationListener listener); boolean addProfileChangeListener(ProfileListener listener); void removeProfileChangeListener(ProfileListener listener); boolean removeMembershipListener(MembershipListener listener); void setInitialized(); boolean initializationGate(); boolean isInitialized(); boolean pollIsInitialized(); void dumpProfiles(String infoMsg); boolean putProfile(Profile profile); synchronized boolean putProfile(Profile newProfile, boolean forceProfile); static boolean isNewerSerialNumber(int newSerialNumber, int oldSerialNumber); void forceNewMembershipVersion(); long startOperation(); void endOperation(long version); void waitForCurrentOperations(); boolean removeId(final ProfileId memberId, boolean crashed, boolean destroyed,
      boolean fromMembershipListener); boolean removeIdWithSerial(InternalDistributedMember memberId, int serialNum,
      boolean regionDestroyed); synchronized boolean containsId(InternalDistributedMember memberId); synchronized int getNumProfiles(); Profile getProfile(ProfileId id); void exchangeProfiles(); Profile createProfile(); Set<InternalDistributedMember> adviseGeneric(); Set adviseProfileExchange(); boolean useAdminMembersForDefault(); boolean accept(ProfileVisitor<T> visitor, T aggregate); Set<InternalDistributedMember> adviseProfileUpdate(); Set<InternalDistributedMember> adviseProfileRemove(); static final int ILLEGAL_SERIAL; }
@Test public void regionSyncScheduledForLostMember() { when(dataPolicy.withPersistence()).thenReturn(false); doCallRealMethod().when(distributionAdvisor).syncForCrashedMember(member, profile); distributionAdvisor.syncForCrashedMember(member, profile); verify(distributedRegion).scheduleSynchronizeForLostMember(member, member, delay); verify(distributedRegion).setRegionSynchronizeScheduled(member); }