|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MemcachedClientBuilder
Builder pattern.Configure XmemcachedClient's options,then build it
| Method Summary | |
|---|---|
void |
addAuthInfo(java.net.InetSocketAddress address,
AuthInfo authInfo)
Add auth info for memcached server |
void |
addStateListener(MemcachedClientStateListener stateListener)
Add a state listener |
MemcachedClient |
build()
Build MemcachedClient by current options. |
java.util.Map<java.net.InetSocketAddress,AuthInfo> |
getAuthInfoMap()
return current all auth info |
BufferAllocator |
getBufferAllocator()
|
CommandFactory |
getCommandFactory()
get xmemcached's command factory |
Configuration |
getConfiguration()
Return the default networking's configuration,you can change them. |
java.lang.String |
getName()
Return the cache instance name |
MemcachedSessionLocator |
getSessionLocator()
|
java.util.Map<SocketOption,java.lang.Object> |
getSocketOptions()
Get all tcp socket options |
Transcoder |
getTranscoder()
Set xmemcached's transcoder,it is used for seriailizing |
boolean |
isFailureMode()
Returns if client is in failure mode. |
void |
removeAuthInfo(java.net.InetSocketAddress address)
Remove auth info for memcached server |
void |
removeStateListener(MemcachedClientStateListener stateListener)
Remove a state listener |
void |
setAuthInfoMap(java.util.Map<java.net.InetSocketAddress,AuthInfo> map)
Configure auth info |
void |
setBufferAllocator(BufferAllocator bufferAllocator)
Set nio ByteBuffer's allocator.Use SimpleBufferAllocator by default.You can choose CachedBufferAllocator. |
void |
setCommandFactory(CommandFactory commandFactory)
set xmemcached's command factory.Default is TextCommandFactory,which implements memcached text protocol. |
void |
setConfiguration(Configuration configuration)
Set the XmemcachedClient's networking configuration(reuseAddr,receiveBufferSize,tcpDelay etc.) |
void |
setConnectionPoolSize(int poolSize)
In a high concurrent enviroment,you may want to pool memcached clients.But a xmemcached client has to start a reactor thread and some thread pools,if you create too many clients,the cost is very large. |
void |
setFailureMode(boolean failureMode)
Configure wheather to set client in failure mode.If set it to true,that means you want to configure client in failure mode. |
void |
setName(java.lang.String name)
Set cache instance name |
void |
setSessionLocator(MemcachedSessionLocator sessionLocator)
Set the XmemcachedClient's session locator.Use ArrayMemcachedSessionLocator by default.If you want to choose consistent hash strategy,set it to KetamaMemcachedSessionLocator |
void |
setSocketOption(SocketOption socketOption,
java.lang.Object value)
Set tcp socket option |
void |
setStateListeners(java.util.List<MemcachedClientStateListener> stateListeners)
Set state listeners,replace current list |
void |
setTranscoder(Transcoder transcoder)
|
| Method Detail |
|---|
MemcachedSessionLocator getSessionLocator()
void setSessionLocator(MemcachedSessionLocator sessionLocator)
sessionLocator - BufferAllocator getBufferAllocator()
void setBufferAllocator(BufferAllocator bufferAllocator)
bufferAllocator - Configuration getConfiguration()
void setConfiguration(Configuration configuration)
configuration -
MemcachedClient build()
throws java.io.IOException
java.io.IOExceptionvoid setConnectionPoolSize(int poolSize)
poolSize - pool size,default is 1Transcoder getTranscoder()
void setTranscoder(Transcoder transcoder)
CommandFactory getCommandFactory()
void addStateListener(MemcachedClientStateListener stateListener)
stateListener - void removeStateListener(MemcachedClientStateListener stateListener)
stateListener - void setStateListeners(java.util.List<MemcachedClientStateListener> stateListeners)
stateListeners - void setCommandFactory(CommandFactory commandFactory)
commandFactory -
void setSocketOption(SocketOption socketOption,
java.lang.Object value)
socketOption - value - java.util.Map<SocketOption,java.lang.Object> getSocketOptions()
void setAuthInfoMap(java.util.Map<java.net.InetSocketAddress,AuthInfo> map)
map - Auth info map,key is memcached server address,and value is the
auth info for the key.java.util.Map<java.net.InetSocketAddress,AuthInfo> getAuthInfoMap()
void addAuthInfo(java.net.InetSocketAddress address,
AuthInfo authInfo)
address - authInfo - void removeAuthInfo(java.net.InetSocketAddress address)
address - java.lang.String getName()
void setName(java.lang.String name)
name - void setFailureMode(boolean failureMode)
failureMode - true is to configure client in failure mode.boolean isFailureMode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||