Examples of MemcachedClient


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

    public ResponseStore createStore() {
        try {
            if (getServers().size() == 0) {
                return ResponseStore.NULL_STORE;
            } else {
                MemcachedClient client = new MemcachedClient(new BinaryConnectionFactory(), getServers());
                return new MemcachedResponseStore(client, _keyPrefix, _readOnly);
            }
        } catch (IOException ex) {
            throw Throwables.propagate(ex);
        }
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.