public static class GrizzlyMemcachedCache.Builder<K,V> extends Object implements CacheBuilder<K,V>
| Constructor and Description |
|---|
GrizzlyMemcachedCache.Builder(String cacheName,
GrizzlyMemcachedCacheManager manager,
org.glassfish.grizzly.nio.transport.TCPNIOTransport transport) |
| Modifier and Type | Method and Description |
|---|---|
GrizzlyMemcachedCache.Builder<K,V> |
allowDisposableConnection(boolean allowDisposableConnection)
Allow or disallow disposable connections
Default is false.
|
GrizzlyMemcachedCache.Builder<K,V> |
borrowValidation(boolean borrowValidation)
Enable or disable the connection validation when the connection is borrowed from the connection pool
Default is false.
|
GrizzlyMemcachedCache<K,V> |
build()
Create an instance of the named
Cache. |
GrizzlyMemcachedCache.Builder<K,V> |
connectTimeoutInMillis(long connectTimeoutInMillis)
Set global connect-timeout
If the given param is negative, the timeout is infite.
|
GrizzlyMemcachedCache.Builder<K,V> |
failover(boolean failover)
Enable or disable failover/failback
Default is true.
|
GrizzlyMemcachedCache.Builder<K,V> |
healthMonitorIntervalInSecs(long healthMonitorIntervalInSecs)
Set health monitor's interval
This cache will schedule HealthMonitorTask with this interval.
|
GrizzlyMemcachedCache.Builder<K,V> |
keepAliveTimeoutInSecs(long keepAliveTimeoutInSecs)
Set connection pool's KeepAliveTimeout
Default is 1800.
|
GrizzlyMemcachedCache.Builder<K,V> |
maxConnectionPerServer(int maxConnectionPerServer)
Set connection pool's max
Default is
Integer.MAX_VALUE |
GrizzlyMemcachedCache.Builder<K,V> |
minConnectionPerServer(int minConnectionPerServer)
Set connection pool's min
Default is 5.
|
GrizzlyMemcachedCache.Builder<K,V> |
preferRemoteConfig(boolean preferRemoteConfig) |
GrizzlyMemcachedCache.Builder<K,V> |
responseTimeoutInMillis(long responseTimeoutInMillis)
Set global response-timeout
If the given param is negative, the timeout is infite.
|
GrizzlyMemcachedCache.Builder<K,V> |
retryCount(int retryCount)
Deprecated.
not supported anymore
|
GrizzlyMemcachedCache.Builder<K,V> |
returnValidation(boolean returnValidation)
Enable or disable the connection validation when the connection is returned to the connection pool
Default is false.
|
GrizzlyMemcachedCache.Builder<K,V> |
servers(Set<SocketAddress> servers)
Set initial servers
|
GrizzlyMemcachedCache.Builder<K,V> |
writeTimeoutInMillis(long writeTimeoutInMillis)
Set global write-timeout
If the given param is negative, the timeout is infite.
|
public GrizzlyMemcachedCache.Builder(String cacheName, GrizzlyMemcachedCacheManager manager, org.glassfish.grizzly.nio.transport.TCPNIOTransport transport)
public GrizzlyMemcachedCache<K,V> build()
Cache.build in interface CacheBuilder<K,V>CacheManager.createCacheBuilder(String)public GrizzlyMemcachedCache.Builder<K,V> connectTimeoutInMillis(long connectTimeoutInMillis)
connectTimeoutInMillis - connect-timeout in milli-secondspublic GrizzlyMemcachedCache.Builder<K,V> writeTimeoutInMillis(long writeTimeoutInMillis)
writeTimeoutInMillis - write-timeout in milli-secondspublic GrizzlyMemcachedCache.Builder<K,V> responseTimeoutInMillis(long responseTimeoutInMillis)
responseTimeoutInMillis - response-timeout in milli-secondspublic GrizzlyMemcachedCache.Builder<K,V> minConnectionPerServer(int minConnectionPerServer)
minConnectionPerServer - connection pool's minBaseObjectPool.Builder#min(int)public GrizzlyMemcachedCache.Builder<K,V> maxConnectionPerServer(int maxConnectionPerServer)
Integer.MAX_VALUEmaxConnectionPerServer - connection pool's maxBaseObjectPool.Builder#max(int)public GrizzlyMemcachedCache.Builder<K,V> keepAliveTimeoutInSecs(long keepAliveTimeoutInSecs)
keepAliveTimeoutInSecs - connection pool's KeepAliveTimeout in secondsBaseObjectPool.Builder#keepAliveTimeoutInSecs(long)public GrizzlyMemcachedCache.Builder<K,V> healthMonitorIntervalInSecs(long healthMonitorIntervalInSecs)
failover to be false.
Default is 60.healthMonitorIntervalInSecs - interval in secondspublic GrizzlyMemcachedCache.Builder<K,V> allowDisposableConnection(boolean allowDisposableConnection)
allowDisposableConnection - true if this cache allows disposable connectionspublic GrizzlyMemcachedCache.Builder<K,V> borrowValidation(boolean borrowValidation)
borrowValidation - true if this cache should make sure the borrowed connection is validpublic GrizzlyMemcachedCache.Builder<K,V> returnValidation(boolean returnValidation)
returnValidation - true if this cache should make sure the returned connection is validpublic GrizzlyMemcachedCache.Builder<K,V> servers(Set<SocketAddress> servers)
servers - server setpublic GrizzlyMemcachedCache.Builder<K,V> failover(boolean failover)
failover - true if this cache should support failover/failback when the server is failed or revivedpublic GrizzlyMemcachedCache.Builder<K,V> retryCount(int retryCount)
public GrizzlyMemcachedCache.Builder<K,V> preferRemoteConfig(boolean preferRemoteConfig)
Copyright © 2015 Project Grizzly. All Rights Reserved.