Class MemcachedConnector

  • All Implemented Interfaces:
    java.lang.Runnable

    public class MemcachedConnector
    extends java.lang.Object
    implements java.lang.Runnable
    Class 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
    • 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)
      • 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.IOException
        javax.management.MalformedObjectNameException
        javax.management.MBeanRegistrationException
      • stop

        public void stop()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable