Class ComposablePoolResolver
java.lang.Object
org.springframework.data.gemfire.client.support.ComposablePoolResolver
- All Implemented Interfaces:
PoolResolver
Composite of
PoolResolvers
functioning as a single PoolResolver
.- Since:
- 2.3.0
- See Also:
-
Pool
PoolResolver
-
Field Summary
Fields inherited from interface org.springframework.data.gemfire.client.PoolResolver
DEFAULT_POOL_NAME
-
Constructor Summary
ModifierConstructorDescriptionprotected
ComposablePoolResolver
(PoolResolver poolResolverOne, PoolResolver poolResolverTwo) Constructs a new instance ofComposablePoolResolver
initialized and composed of twoPoolResolver
implementations that will function as one. -
Method Summary
Modifier and TypeMethodDescriptionstatic PoolResolver
compose
(Iterable<PoolResolver> poolResolvers) Null-safe factory method to compose anIterable
ofPoolResolver
objects.static PoolResolver
compose
(PoolResolver... poolResolvers) Null-safe factory method to compose an array ofPoolResolver
objects.static PoolResolver
compose
(PoolResolver one, PoolResolver two) Null-safe factory method to compose twoPoolResolver
objects in a composition.protected PoolResolver
Returns a reference to the firstPoolResolver
in the composition.protected PoolResolver
Returns a reference to the secondPoolResolver
in the composition.org.apache.geode.cache.client.Pool
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.gemfire.client.PoolResolver
require, resolve, resolve
-
Constructor Details
-
ComposablePoolResolver
Constructs a new instance ofComposablePoolResolver
initialized and composed of twoPoolResolver
implementations that will function as one.- Parameters:
poolResolverOne
- firstPoolResolver
in the composition order.poolResolverTwo
- secondPoolResolver
in the composition order.- Throws:
IllegalArgumentException
- if either the first or secondPoolResolver
are null.- See Also:
-
-
Method Details
-
compose
Null-safe factory method to compose an array ofPoolResolver
objects. Preserves order in the composition.- Parameters:
poolResolvers
- array ofPoolResolver
objects to compose.- Returns:
- a composition from the array of
PoolResolver
objects; may return null. - See Also:
-
compose
Null-safe factory method to compose anIterable
ofPoolResolver
objects. Preserves order in the composition if theIterable
collection-like data structure is ordered, like aList
).- Parameters:
poolResolvers
-Iterable
ofPoolResolver
objects to compose.- Returns:
- a composition from the
Iterable
ofPoolResolver
objects; may return null. - See Also:
-
compose
@Nullable public static PoolResolver compose(@Nullable PoolResolver one, @Nullable PoolResolver two) Null-safe factory method to compose twoPoolResolver
objects in a composition.- Parameters:
one
- firstPoolResolver
in the composition.two
- secondPoolResolver
in the composition.- Returns:
- a composition from the two
PoolResolver
objects. Returns the firstPoolResolver
if the secondPoolResolver
is null. Returns the secondPoolResolver
if the firstPoolResolver
is null. Returns null if bothPoolResolver
arguments are null. - See Also:
-
getPoolResolverOne
Returns a reference to the firstPoolResolver
in the composition.- Returns:
- a reference to the first
PoolResolver
in the composition. - See Also:
-
getPoolResolverTwo
Returns a reference to the secondPoolResolver
in the composition.- Returns:
- a reference to the second
PoolResolver
in the composition. - See Also:
-
resolve
Attempts to resolve aPool
with the givenname
by delegating to the composedPoolResolver
objects. The firstPoolResolver
in the composition to resolve aPool
with the givenname
stops the resolution process and returns the targetPool
. If noPool
with the givenname
can be resolved by anyPoolResolver
in the composition, then null will be returned.- Specified by:
resolve
in interfacePoolResolver
- Parameters:
poolName
-name
of thePool
to resolve.- Returns:
- the resolved
Pool
or null if aPool
withname
cannot be resolved. - See Also:
-