Examples of MemcachedClient


Examples of net.spy.memcached.MemcachedClient

*/
@Test
public class TextMemcachedActionTests extends AbstractMemcachedActionsTests {

    @Override protected MemcachedClient createMemcachedClient() throws IOException {
        return new MemcachedClient(AddrUtil.getAddresses("localhost:11211"));
    }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

*/
@Test
public class BinaryMemcachedActionTests extends AbstractMemcachedActionsTests {

    @Override protected MemcachedClient createMemcachedClient() throws IOException {
        return new MemcachedClient(new BinaryConnectionFactory(), AddrUtil.getAddresses("localhost:11211"));
    }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

    if(client == null){
      cacheValid = false;
      if(WebVariable.useMemcached){
        try {
          int serverCount = WebVariable.memcachedHosts.split(" ").length;
          client = new MemcachedClient(
    //          "xxxx:11211 yyyy:11211"
                  AddrUtil.getAddresses(hosts));
          Thread.sleep(2000);
          Collection<SocketAddress> unavailableServers = client.getUnavailableServers();
          if(unavailableServers.size()==serverCount){
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

        return new KestrelEndpoint(uri, this, config, queue);
    }

    public MemcachedClient getMemcachedClient(KestrelConfiguration config, String queue) {
        String key = config.getAddressesAsString() + "/" + queue;
        MemcachedClient memcachedClient = memcachedClientCache.get(key);
        if (memcachedClient != null) {
            return memcachedClient;
        }
        synchronized (memcachedClientCache) {
            if ((memcachedClient = memcachedClientCache.get(key)) == null) {
                LOG.info("Creating MemcachedClient for " + key);
                try {
                    memcachedClient = new MemcachedClient(memcachedConnectionFactory, config.getInetSocketAddresses());
                } catch (Exception e) {
                    throw new RuntimeCamelException("Failed to connect to " + key, e);
                }
                memcachedClientCache.put(key, memcachedClient);
            }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

      sb.append(s + " ");
    }
    this.poolName = poolName;
    try {
      for(int i = 0;i < getPoolSize() ;i++) {
        memPool.add(new MemcachedClient(new KetamaConnectionFactory(), AddrUtil.getAddresses(sb.toString())));
      }
      //client.setTranscoder(new SerializingTranscoder());
      //Logger.getLogger(SerializingTranscoder.class.getName()).setLevel(Level.WARNING);
      //client.setTranscoder(new WhalinTranscoder());
    } catch (Exception e) {
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

     * machine as your application, for example.
     * @param address where the <i>memcached</i> daemon is running
     * @throws IOException in case of an error
     */
    public MemcachedHttpCacheStorage(InetSocketAddress address) throws IOException {
        this(new MemcachedClient(address));
    }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

        return new KestrelEndpoint(uri, this, config, queue);
    }

    public MemcachedClient getMemcachedClient(KestrelConfiguration config, String queue) {
        String key = config.getAddressesAsString() + "/" + queue;
        MemcachedClient memcachedClient = memcachedClientCache.get(key);
        if (memcachedClient != null) {
            return memcachedClient;
        }
        synchronized (memcachedClientCache) {
            if ((memcachedClient = memcachedClientCache.get(key)) == null) {
                LOG.info("Creating MemcachedClient for " + key);
                try {
                    memcachedClient = new MemcachedClient(memcachedConnectionFactory, config.getInetSocketAddresses());
                } catch (Exception e) {
                    throw new RuntimeCamelException("Failed to connect to " + key, e);
                }
                memcachedClientCache.put(key, memcachedClient);
            }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

     * machine as your application, for example.
     * @param address where the <i>memcached</i> daemon is running
     * @throws IOException in case of an error
     */
    public MemcachedHttpCacheStorage(final InetSocketAddress address) throws IOException {
        this(new MemcachedClient(address));
    }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

        return new KestrelEndpoint(uri, this, config, queue);
    }

    public MemcachedClient getMemcachedClient(KestrelConfiguration config, String queue) {
        String key = config.getAddressesAsString() + "/" + queue;
        MemcachedClient memcachedClient = memcachedClientCache.get(key);
        if (memcachedClient != null) {
            return memcachedClient;
        }
        synchronized (memcachedClientCache) {
            if ((memcachedClient = memcachedClientCache.get(key)) == null) {
                LOG.info("Creating MemcachedClient for " + key);
                try {
                    memcachedClient = new MemcachedClient(memcachedConnectionFactory, config.getInetSocketAddresses());
                } catch (Exception e) {
                    throw new RuntimeCamelException("Failed to connect to " + key, e);
                }
                memcachedClientCache.put(key, memcachedClient);
            }
View Full Code Here

Examples of net.spy.memcached.MemcachedClient

    private MemcachedClientIF client;
    private HttpCacheEntrySerializer serializer;
    private final int maxUpdateRetries;

    public MemcachedHttpCacheStorage(InetSocketAddress address) throws IOException {
        this(new MemcachedClient(address));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.