public class ComposablePoolResolver extends Object implements PoolResolver
PoolResolvers
functioning as a single PoolResolver
.Pool
,
PoolResolver
DEFAULT_POOL_NAME
Modifier | Constructor and Description |
---|---|
protected |
ComposablePoolResolver(PoolResolver poolResolverOne,
PoolResolver poolResolverTwo)
Constructs a new instance of
ComposablePoolResolver initialized and composed of two PoolResolver
implementations that will function as one. |
Modifier and Type | Method and Description |
---|---|
static PoolResolver |
compose(Iterable<PoolResolver> poolResolvers)
Null-safe factory method to compose an
Iterable of PoolResolver objects. |
static PoolResolver |
compose(PoolResolver... poolResolvers)
Null-safe factory method to compose an array of
PoolResolver objects. |
static PoolResolver |
compose(PoolResolver one,
PoolResolver two)
Null-safe factory method to compose two
PoolResolver objects in a composition. |
protected PoolResolver |
getPoolResolverOne()
Returns a reference to the first
PoolResolver in the composition. |
protected PoolResolver |
getPoolResolverTwo()
Returns a reference to the second
PoolResolver in the composition. |
org.apache.geode.cache.client.Pool |
resolve(String poolName)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
require, resolve, resolve
protected ComposablePoolResolver(PoolResolver poolResolverOne, PoolResolver poolResolverTwo)
ComposablePoolResolver
initialized and composed of two PoolResolver
implementations that will function as one.poolResolverOne
- first PoolResolver
in the composition order.poolResolverTwo
- second PoolResolver
in the composition order.IllegalArgumentException
- if either the first or second PoolResolver
are null.PoolResolver
@Nullable public static PoolResolver compose(@Nullable PoolResolver... poolResolvers)
PoolResolver
objects.
Preserves order in the composition.poolResolvers
- array of PoolResolver
objects to compose.PoolResolver
objects; may return null.PoolResolver
,
compose(Iterable)
@Nullable public static PoolResolver compose(@Nullable Iterable<PoolResolver> poolResolvers)
Iterable
of PoolResolver
objects.
Preserves order in the composition if the Iterable
collection-like data structure is ordered,
like a List
).poolResolvers
- Iterable
of PoolResolver
objects to compose.Iterable
of PoolResolver
objects; may return null.PoolResolver
,
Iterable
,
compose(PoolResolver, PoolResolver)
@Nullable public static PoolResolver compose(@Nullable PoolResolver one, @Nullable PoolResolver two)
PoolResolver
objects in a composition.one
- first PoolResolver
in the composition.two
- second PoolResolver
in the composition.PoolResolver
objects. Returns the first PoolResolver
if the second PoolResolver
is null. Returns the second PoolResolver
if the first
PoolResolver
is null. Returns null if both PoolResolver
arguments
are null.PoolResolver
,
ComposablePoolResolver(PoolResolver, PoolResolver)
@NonNull protected PoolResolver getPoolResolverOne()
PoolResolver
in the composition.PoolResolver
in the composition.PoolResolver
@NonNull protected PoolResolver getPoolResolverTwo()
PoolResolver
in the composition.PoolResolver
in the composition.PoolResolver
@Nullable public org.apache.geode.cache.client.Pool resolve(@Nullable String poolName)
Pool
with the given name
by delegating to the composed
PoolResolver
objects.
The first PoolResolver
in the composition to resolve a Pool
with the given name
stops the resolution process and returns the target Pool
. If no Pool
with the given
name
can be resolved by any PoolResolver
in the composition, then null
will be returned.resolve
in interface PoolResolver
poolName
- name
of the Pool
to resolve.Pool
or null if a Pool
with name
cannot be resolved.Pool
,
getPoolResolverOne()
,
getPoolResolverTwo()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.