Class MemcachedClientFactoryBean

java.lang.Object
net.spy.memcached.spring.MemcachedClientFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

public class MemcachedClientFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A Spring FactoryBean creating MemcachedClient instances.

Usage example:

 
 <bean id="memcachedClient"
     class="net.spy.memcached.utils.MemcachedClientFactoryBean">
   <property name="servers" value="${pajamas.remoteHosts}"/>
   <property name="protocol" value="${pajamas.client.protocol}"/>
   <property name="transcoder"/>
   <bean class="net.rubyeye.xmemcached.transcoders.SerializingTranscoder"/>
   <property name="hashAlg" value="${pajamas.client.hashAlg}"/>
   <property name="locatorType" value="${pajamas.client.locatorType}"/>
 
 
Author:
Eran Harel
  • Constructor Details

    • MemcachedClientFactoryBean

      public MemcachedClientFactoryBean()
  • Method Details

    • getObject

      public Object getObject() throws Exception
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean
      Throws:
      Exception
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • setServers

      public void setServers(String newServers)
    • setAuthDescriptor

      public void setAuthDescriptor(AuthDescriptor to)
    • setDaemon

      public void setDaemon(boolean d)
    • setFailureMode

      public void setFailureMode(FailureMode fm)
    • setHashAlg

      public void setHashAlg(HashAlgorithm to)
    • setInitialObservers

      public void setInitialObservers(Collection<ConnectionObserver> obs)
    • setLocatorType

      public void setLocatorType(ConnectionFactoryBuilder.Locator l)
    • setMaxReconnectDelay

      public void setMaxReconnectDelay(long to)
    • setOpFact

      public void setOpFact(OperationFactory f)
    • setOpQueueFactory

      public void setOpQueueFactory(OperationQueueFactory q)
    • setOpQueueMaxBlockTime

      public void setOpQueueMaxBlockTime(long t)
    • setOpTimeout

      public void setOpTimeout(long t)
    • setProtocol

      public void setProtocol(ConnectionFactoryBuilder.Protocol prot)
    • setReadBufferSize

      public void setReadBufferSize(int to)
    • setReadOpQueueFactory

      public void setReadOpQueueFactory(OperationQueueFactory q)
    • setShouldOptimize

      public void setShouldOptimize(boolean o)
    • setTimeoutExceptionThreshold

      public void setTimeoutExceptionThreshold(int to)
    • setTranscoder

      public void setTranscoder(Transcoder<Object> t)
    • setUseNagleAlgorithm

      public void setUseNagleAlgorithm(boolean to)
    • setWriteOpQueueFactory

      public void setWriteOpQueueFactory(OperationQueueFactory q)
    • setShutdownTimeoutSeconds

      public void setShutdownTimeoutSeconds(long shutdownTimeoutSeconds)
      The number of seconds to wait for connections to finish before shutting down the client.