public class RoundRobinConnectionStrategy extends Object implements ConnectionStrategy
useConnectionCount to false if using this strategy with a connection pool.ACTIVE_PASSIVE, DEFAULT, RANDOM, ROUND_ROBIN| Constructor and Description |
|---|
RoundRobinConnectionStrategy()
Creates a new round robin connection strategy.
|
RoundRobinConnectionStrategy(boolean b)
Creates a new round robin connection strategy.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
getCount(int connectionCount)
Returns the supplied connection count if
useConnectionCount is true. |
String[] |
getLdapUrls(ConnectionFactoryMetadata metadata)
Return a list of URLs that cycles the list order.
|
public RoundRobinConnectionStrategy()
public RoundRobinConnectionStrategy(boolean b)
b - whether getLdapUrls(ConnectionFactoryMetadata) should use the connectionCount parameterpublic String[] getLdapUrls(ConnectionFactoryMetadata metadata)
getLdapUrls in interface ConnectionStrategymetadata - which can be used to produce the URL listprotected int getCount(int connectionCount)
useConnectionCount is true. Otherwise returns invocationCount.connectionCount - as reported by the connectionCopyright © 2023. All rights reserved.