Spring Data for VMware GemFire
Class ComposableRegionResolver
java.lang.Object
org.apache.geode.cache.util.CacheListenerAdapter
org.springframework.data.gemfire.support.AbstractCachingRegionResolver
org.springframework.data.gemfire.support.ComposableRegionResolver
- All Implemented Interfaces:
org.apache.geode.cache.CacheCallback,org.apache.geode.cache.CacheListener,org.apache.geode.cache.Declarable,RegionResolver
RegionResolver implementation used to compose a collection of RegionResolvers.- Since:
- 2.3.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComposableRegionResolver(RegionResolver regionResolverOne, RegionResolver regionResolverTwo) Constructs a new instance ofComposableRegionResolverinitialized and composed with the givenRegionResolversforming the composition. -
Method Summary
Modifier and TypeMethodDescriptionstatic RegionResolvercompose(Iterable<RegionResolver> regionResolvers) Factory method used to compose an Iterable collection ofRegionResolversin a composition.static RegionResolvercompose(RegionResolver... regionResolvers) Factory method used to compose an array ofRegionResolversin a composition.static RegionResolvercompose(RegionResolver one, RegionResolver two) Composes twoRegionResolversin a composition.protected <K,V> org.apache.geode.cache.Region<K, V> Resolves the first non-null reference to cacheRegionidentified by the givenname, handling anyExceptionsthrowing by the composedRegionResolvers, such as aRegionDestroyedException.protected RegionResolverReturns a reference to the first, non-null, configuredRegionResolverin the composition.protected RegionResolverReturns a reference to the second, non-null, configuredRegionResolverin the composition.Methods inherited from class org.springframework.data.gemfire.support.AbstractCachingRegionResolver
afterRegionDestroy, resolveMethods inherited from class org.apache.geode.cache.util.CacheListenerAdapter
afterCreate, afterDestroy, afterInvalidate, afterRegionClear, afterRegionCreate, afterRegionInvalidate, afterRegionLive, afterUpdate, closeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.geode.cache.Declarable
init, initializeMethods inherited from interface org.springframework.data.gemfire.RegionResolver
require
-
Constructor Details
-
ComposableRegionResolver
protected ComposableRegionResolver(@NonNull RegionResolver regionResolverOne, @NonNull RegionResolver regionResolverTwo) Constructs a new instance ofComposableRegionResolverinitialized and composed with the givenRegionResolversforming the composition.- Parameters:
regionResolverOne- firstRegionResolverin the composition; must not be null.regionResolverTwo- secondRegionResolverin the composition; must not be null.- Throws:
IllegalArgumentException- if eitherRegionResolverargument is null.- See Also:
-
-
Method Details
-
compose
Factory method used to compose an array ofRegionResolversin a composition.- Parameters:
regionResolvers- array ofRegionResolversto compose; may be null.- Returns:
- a composition from the array of
RegionResolvers; may be null. - See Also:
-
compose
Factory method used to compose an Iterable collection ofRegionResolversin a composition.- Parameters:
regionResolvers-Iterablecollection ofRegionResolversto compose; may be null.- Returns:
- a composition from the
Iterablecollection ofRegionResolvers; may be null. - See Also:
-
compose
@Nullable public static RegionResolver compose(@Nullable RegionResolver one, @Nullable RegionResolver two) Composes twoRegionResolversin a composition.- Parameters:
one- firstRegionResolverin the composition.two- secondRegionResolverin the composition.- Returns:
- a
ComposableRegionResolvercomposed of theRegionResolverarguments. Returns the firstRegionResolverif the second is null. Returns the secondRegionResolverif the first is null. Returns null if bothRegionResolverarguments are null. - See Also:
-
getRegionResolverOne
Returns a reference to the first, non-null, configuredRegionResolverin the composition.- Returns:
- a reference to the first
RegionResolverin the composition. - See Also:
-
getRegionResolverTwo
Returns a reference to the second, non-null, configuredRegionResolverin the composition.- Returns:
- a reference to the second
RegionResolverin the composition. - See Also:
-
doResolve
@Nullable protected <K,V> org.apache.geode.cache.Region<K,V> doResolve(@Nullable String regionName) Resolves the first non-null reference to cacheRegionidentified by the givenname, handling anyExceptionsthrowing by the composedRegionResolvers, such as aRegionDestroyedException. This method may ultimately still result in a thrownException, but it will make a best effort to exhaustively consult all composedRegionResolvers.
-