Spring Data for VMware GemFire
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:
-
PoolPoolResolver
-
Field Summary
Fields inherited from interface org.springframework.data.gemfire.client.PoolResolver
DEFAULT_POOL_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComposablePoolResolver(PoolResolver poolResolverOne, PoolResolver poolResolverTwo) Constructs a new instance ofComposablePoolResolverinitialized and composed of twoPoolResolverimplementations that will function as one. -
Method Summary
Modifier and TypeMethodDescriptionstatic PoolResolvercompose(Iterable<PoolResolver> poolResolvers) Null-safe factory method to compose anIterableofPoolResolverobjects.static PoolResolvercompose(PoolResolver... poolResolvers) Null-safe factory method to compose an array ofPoolResolverobjects.static PoolResolvercompose(PoolResolver one, PoolResolver two) Null-safe factory method to compose twoPoolResolverobjects in a composition.protected PoolResolverReturns a reference to the firstPoolResolverin the composition.protected PoolResolverReturns a reference to the secondPoolResolverin the composition.org.apache.geode.cache.client.PoolMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.gemfire.client.PoolResolver
require, resolve, resolve
-
Constructor Details
-
ComposablePoolResolver
Constructs a new instance ofComposablePoolResolverinitialized and composed of twoPoolResolverimplementations that will function as one.- Parameters:
poolResolverOne- firstPoolResolverin the composition order.poolResolverTwo- secondPoolResolverin the composition order.- Throws:
IllegalArgumentException- if either the first or secondPoolResolverare null.- See Also:
-
-
Method Details
-
compose
Null-safe factory method to compose an array ofPoolResolverobjects. Preserves order in the composition.- Parameters:
poolResolvers- array ofPoolResolverobjects to compose.- Returns:
- a composition from the array of
PoolResolverobjects; may return null. - See Also:
-
compose
Null-safe factory method to compose anIterableofPoolResolverobjects. Preserves order in the composition if theIterablecollection-like data structure is ordered, like aList).- Parameters:
poolResolvers-IterableofPoolResolverobjects to compose.- Returns:
- a composition from the
IterableofPoolResolverobjects; may return null. - See Also:
-
compose
@Nullable public static PoolResolver compose(@Nullable PoolResolver one, @Nullable PoolResolver two) Null-safe factory method to compose twoPoolResolverobjects in a composition.- Parameters:
one- firstPoolResolverin the composition.two- secondPoolResolverin the composition.- Returns:
- a composition from the two
PoolResolverobjects. Returns the firstPoolResolverif the secondPoolResolveris null. Returns the secondPoolResolverif the firstPoolResolveris null. Returns null if bothPoolResolverarguments are null. - See Also:
-
getPoolResolverOne
Returns a reference to the firstPoolResolverin the composition.- Returns:
- a reference to the first
PoolResolverin the composition. - See Also:
-
getPoolResolverTwo
Returns a reference to the secondPoolResolverin the composition.- Returns:
- a reference to the second
PoolResolverin the composition. - See Also:
-
resolve
Attempts to resolve aPoolwith the givennameby delegating to the composedPoolResolverobjects. The firstPoolResolverin the composition to resolve aPoolwith the givennamestops the resolution process and returns the targetPool. If noPoolwith the givennamecan be resolved by anyPoolResolverin the composition, then null will be returned.- Specified by:
resolvein interfacePoolResolver- Parameters:
poolName-nameof thePoolto resolve.- Returns:
- the resolved
Poolor null if aPoolwithnamecannot be resolved. - See Also:
-