public interface Pool
A single instance of this interface can be created using ClientCacheFactory.create()
.
Multiple instances may also be created using PoolFactory.create(java.lang.String)
. A PoolFactory
instance is created by calling PoolManager.createFactory()
. So to create a default
Pool
do this:
new ClientCacheFactory().create();or this:
PoolManager.createFactory().create("myPool");Instances may also be created by declaring them in cache.xml with a
pool
element.
Existing Pool instances can be found using PoolManager.find(String)
and
PoolManager.getAll()
.
The pool name must be configured on the client regions that will use this pool by calling
RegionFactory.setPoolName(java.lang.String)
.
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys this pool closing any connections it produced.
|
void |
destroy(boolean keepAlive)
Destroys this pool closing any connections it produced.
|
int |
getFreeConnectionTimeout()
Returns the connection timeout of this pool.
|
long |
getIdleTimeout()
Get the maximum connections for this pool.
|
int |
getLoadConditioningInterval()
Returns the load conditioning interval of this pool.
|
java.util.List<java.net.InetSocketAddress> |
getLocators()
Returns an unmodifiable list of
InetSocketAddress of the locators this pool is
using. |
int |
getMaxConnections()
Get the maximum connections for this pool.
|
int |
getMinConnections()
Get the minimum connections for this pool.
|
boolean |
getMultiuserAuthentication()
Returns true if multiuser mode is enabled on this pool.
|
java.lang.String |
getName()
Get the name of the connection pool
|
int |
getPendingEventCount()
Returns the approximate number of pending subscription events maintained at server for this
durable client pool at the time it (re)connected to the server.
|
long |
getPingInterval()
Get the ping interval for this pool.
|
boolean |
getPRSingleHopEnabled()
Returns true if single-hop optimisation is enabled on this pool.
|
QueryService |
getQueryService()
Returns the QueryService for this Pool.
|
int |
getReadTimeout()
Returns the read timeout of this pool.
|
int |
getRetryAttempts()
Get the retry attempts for this pool.
|
java.lang.String |
getServerGroup()
Returns the server group of this pool.
|
java.util.List<java.net.InetSocketAddress> |
getServers()
Returns an unmodifiable list of
InetSocketAddress of the servers this pool is
using. |
int |
getSocketBufferSize()
Returns the socket buffer size of this pool.
|
int |
getStatisticInterval()
Get the statistic interval for this pool.
|
int |
getSubscriptionAckInterval()
Returns the subscription ack interval of this pool.
|
boolean |
getSubscriptionEnabled()
Returns the true if a server-to-client subscriptions are enabled on this pool.
|
int |
getSubscriptionMessageTrackingTimeout()
Returns the subscription message tracking timeout of this pool.
|
int |
getSubscriptionRedundancy()
Returns the subscription redundancy level of this pool.
|
boolean |
getThreadLocalConnections()
Returns
true if thread local connections are enabled on this pool. |
boolean |
isDestroyed()
Indicates whether this Pool has been destroyed.
|
void |
releaseThreadLocalConnection()
If this pool was configured to to use thread local connections, then this method will release
the connection cached for the calling thread.
|
java.lang.String getName()
PoolFactory.create(java.lang.String)
int getFreeConnectionTimeout()
int getLoadConditioningInterval()
int getSocketBufferSize()
PoolFactory.setSocketBufferSize(int)
int getReadTimeout()
PoolFactory.setReadTimeout(int)
int getMinConnections()
PoolFactory.setMinConnections(int)
int getMaxConnections()
PoolFactory.setMaxConnections(int)
long getIdleTimeout()
PoolFactory.setIdleTimeout(long)
long getPingInterval()
PoolFactory.setPingInterval(long)
int getStatisticInterval()
PoolFactory.setStatisticInterval(int)
int getRetryAttempts()
PoolFactory.setRetryAttempts(int)
boolean getThreadLocalConnections()
true
if thread local connections are enabled on this pool.boolean getSubscriptionEnabled()
boolean getPRSingleHopEnabled()
PoolFactory.setPRSingleHopEnabled(boolean)
int getSubscriptionRedundancy()
int getSubscriptionMessageTrackingTimeout()
int getSubscriptionAckInterval()
java.lang.String getServerGroup()
boolean getMultiuserAuthentication()
PoolFactory.setMultiuserAuthentication(boolean)
java.util.List<java.net.InetSocketAddress> getLocators()
InetSocketAddress
of the locators this pool is
using. Each locator is either one added explicitly
when the pool
was created or were discovered using the explicit locators.
If a pool has no locators then it can not discover servers or locators at runtime.
java.util.List<java.net.InetSocketAddress> getServers()
InetSocketAddress
of the servers this pool is
using. These servers where either added explicitly
when the pool
was created or were discovered using this pools locators
.void destroy(boolean keepAlive)
keepAlive
- whether the server should keep the durable client's subscriptions alive for
the timeout periodjava.lang.IllegalStateException
- if the pool is still in usevoid destroy()
java.lang.IllegalStateException
- if the pool is still in useboolean isDestroyed()
void releaseThreadLocalConnection()
QueryService getQueryService()
int getPendingEventCount()
ClientCache.readyForEvents()
from it.
Durable clients can call this method on reconnect to assess the amount of 'stale' data i.e.
events accumulated at server while this client was away and, importantly, before calling
ClientCache.readyForEvents()
.
Any number of invocations of this method during a single session will return the same value.
It may return a zero value if there are no events pending at server for this client pool. A negative value returned tells us that no queue was available at server for this client pool.
A value -1 indicates that this client pool reconnected to server after its 'durable-client-timeout' period elapsed and hence its subscription queue at server was removed, possibly causing data loss.
A value -2 indicates that this client pool connected to server for the first time.
java.lang.IllegalStateException
- If called by a non-durable client or if invoked any time after
invocation of ClientCache.readyForEvents()
.