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:
CacheCallback
,CacheListener
,Declarable
,RegionResolver
RegionResolver
implementation used to compose a collection of RegionResolvers
.- Since:
- 2.3.0
- Author:
- John Blum
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
ComposableRegionResolver
(RegionResolver regionResolverOne, RegionResolver regionResolverTwo) Constructs a new instance ofComposableRegionResolver
initialized and composed with the givenRegionResolvers
forming the composition. -
Method Summary
Modifier and TypeMethodDescriptionstatic RegionResolver
compose
(Iterable<RegionResolver> regionResolvers) Factory method used to compose an Iterable collection ofRegionResolvers
in a composition.static RegionResolver
compose
(RegionResolver... regionResolvers) Factory method used to compose an array ofRegionResolvers
in a composition.static RegionResolver
compose
(RegionResolver one, RegionResolver two) Composes twoRegionResolvers
in a composition.protected <K,
V> Region<K, V> Resolves the first non-null reference to cacheRegion
identified by the givenname
, handling anyExceptions
throwing by the composedRegionResolvers
, such as aRegionDestroyedException
.protected RegionResolver
Returns a reference to the first, non-null, configuredRegionResolver
in the composition.protected RegionResolver
Returns a reference to the second, non-null, configuredRegionResolver
in the composition.Methods inherited from class org.springframework.data.gemfire.support.AbstractCachingRegionResolver
afterRegionDestroy, resolve
Methods inherited from class org.apache.geode.cache.util.CacheListenerAdapter
afterCreate, afterDestroy, afterInvalidate, afterRegionClear, afterRegionCreate, afterRegionInvalidate, afterRegionLive, afterUpdate, close
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.geode.cache.Declarable
init, initialize
Methods inherited from interface org.springframework.data.gemfire.RegionResolver
require
-
Constructor Details
-
ComposableRegionResolver
protected ComposableRegionResolver(@NonNull RegionResolver regionResolverOne, @NonNull RegionResolver regionResolverTwo) Constructs a new instance ofComposableRegionResolver
initialized and composed with the givenRegionResolvers
forming the composition.- Parameters:
regionResolverOne
- firstRegionResolver
in the composition; must not be null.regionResolverTwo
- secondRegionResolver
in the composition; must not be null.- Throws:
IllegalArgumentException
- if eitherRegionResolver
argument is null.- See Also:
-
-
Method Details
-
compose
Factory method used to compose an array ofRegionResolvers
in a composition.- Parameters:
regionResolvers
- array ofRegionResolvers
to 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 ofRegionResolvers
in a composition.- Parameters:
regionResolvers
-Iterable
collection ofRegionResolvers
to compose; may be null.- Returns:
- a composition from the
Iterable
collection ofRegionResolvers
; may be null. - See Also:
-
compose
@Nullable public static RegionResolver compose(@Nullable RegionResolver one, @Nullable RegionResolver two) Composes twoRegionResolvers
in a composition.- Parameters:
one
- firstRegionResolver
in the composition.two
- secondRegionResolver
in the composition.- Returns:
- a
ComposableRegionResolver
composed of theRegionResolver
arguments. Returns the firstRegionResolver
if the second is null. Returns the secondRegionResolver
if the first is null. Returns null if bothRegionResolver
arguments are null. - See Also:
-
getRegionResolverOne
Returns a reference to the first, non-null, configuredRegionResolver
in the composition.- Returns:
- a reference to the first
RegionResolver
in the composition. - See Also:
-
getRegionResolverTwo
Returns a reference to the second, non-null, configuredRegionResolver
in the composition.- Returns:
- a reference to the second
RegionResolver
in the composition. - See Also:
-
doResolve
Resolves the first non-null reference to cacheRegion
identified by the givenname
, handling anyExceptions
throwing 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
.
-