apache-geode-extensions/src/main/java/org/springframework/geode/distributed/event/MembershipListenerAdapter.java
/**
	 * Registers this {@link MembershipListener} with the given {@literal peer} {@link Cache}.
	 *
	 * @param peerCache {@literal peer} {@link Cache} on which to register this {@link MembershipListener}.
	 * @return this {@link MembershipListenerAdapter}.
	 * @see org.apache.geode.cache.Cache
	 */
Registers this  MembershipListener with the given  peer  Cache.
@param peerCache  peer  Cache on which to register this  MembershipListener.
Registers this MembershipListener with the given peer Cache . @param peerCache peer Cache on which to register this MembershipListener .
@SuppressWarnings("unchecked")
	public T register(Cache peerCache) {
		Optional.ofNullable(peerCache)
			.map(Cache::getDistributedSystem)
			.filter(InternalDistributedSystem.class::isInstance)
			.map(InternalDistributedSystem.class::cast)
			.map(InternalDistributedSystem::getDistributionManager)
			.ifPresent(distributionManager -> distributionManager
				.addMembershipListener(this));
		return (T) this;
	}
@ SuppressWarnings ( "unchecked" ) public T register ( Cache peerCache ) { Optional . ofNullable ( peerCache ) . map ( Cache :: getDistributedSystem ) . filter ( InternalDistributedSystem . class :: isInstance ) . map ( InternalDistributedSystem . class :: cast ) . map ( InternalDistributedSystem :: getDistributionManager ) . ifPresent ( distributionManager -> distributionManager . addMembershipListener ( this ) ) ; return ( T ) this ; }
Registers this {@link MembershipListener} with the given {@literal peer} {@link Cache}.
Registers this { @link MembershipListener } with the given { @literal peer } { @link Cache } .