Package org.jgroups.blocks
Class MemcachedConnector
- java.lang.Object
-
- org.jgroups.blocks.MemcachedConnector
-
- All Implemented Interfaces:
java.lang.Runnable
public class MemcachedConnector extends java.lang.Object implements java.lang.RunnableClass which listens on a server socket for memcached clients, reads the requests, forwards them to an instance of PartitionedHashMap and sends the response. A memcached client should be able to work without changes once the memcached protocol (http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt) has been implemented completely.- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMemcachedConnector.Request
-
Constructor Summary
Constructors Constructor Description MemcachedConnector(java.net.InetAddress bind_addr, int port, PartitionedHashMap<java.lang.String,byte[]> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.InetAddressgetBindAddress()PartitionedHashMap<java.lang.String,byte[]>getCache()intgetPort()java.util.Map<java.lang.String,java.lang.Object>getStats()java.util.concurrent.ExecutorgetThreadPool()intgetThreadPoolCoreThreads()longgetThreadPoolIdleTime()intgetThreadPoolMaxThreads()voidrun()voidsetBindAddress(java.net.InetAddress bind_addr)voidsetCache(PartitionedHashMap<java.lang.String,byte[]> cache)voidsetPort(int port)voidsetThreadPool(java.util.concurrent.Executor thread_pool)voidsetThreadPoolCoreThreads(int core_threads)voidsetThreadPoolIdleTime(long idle_time)voidsetThreadPoolMaxThreads(int max_threads)voidstart()voidstop()
-
-
-
Constructor Detail
-
MemcachedConnector
public MemcachedConnector(java.net.InetAddress bind_addr, int port, PartitionedHashMap<java.lang.String,byte[]> cache)
-
-
Method Detail
-
getBindAddress
public java.net.InetAddress getBindAddress()
-
setBindAddress
public void setBindAddress(java.net.InetAddress bind_addr)
-
getPort
public int getPort()
-
setPort
public void setPort(int port)
-
getCache
public PartitionedHashMap<java.lang.String,byte[]> getCache()
-
setCache
public void setCache(PartitionedHashMap<java.lang.String,byte[]> cache)
-
getThreadPoolCoreThreads
public int getThreadPoolCoreThreads()
-
setThreadPoolCoreThreads
public void setThreadPoolCoreThreads(int core_threads)
-
getThreadPoolMaxThreads
public int getThreadPoolMaxThreads()
-
setThreadPoolMaxThreads
public void setThreadPoolMaxThreads(int max_threads)
-
getThreadPoolIdleTime
public long getThreadPoolIdleTime()
-
setThreadPoolIdleTime
public void setThreadPoolIdleTime(long idle_time)
-
getThreadPool
public java.util.concurrent.Executor getThreadPool()
-
setThreadPool
public void setThreadPool(java.util.concurrent.Executor thread_pool)
-
getStats
public java.util.Map<java.lang.String,java.lang.Object> getStats()
-
start
public void start() throws java.io.IOException, javax.management.MalformedObjectNameException, javax.management.MBeanRegistrationException- Throws:
java.io.IOExceptionjavax.management.MalformedObjectNameExceptionjavax.management.MBeanRegistrationException
-
stop
public void stop() throws java.io.IOException- Throws:
java.io.IOException
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
-