Package net.spy.memcached

Examples of net.spy.memcached.DefaultConnectionFactory


      if (memcachedClient != null) {
         log.warn("Service already started");
         return;
      }
      try {
         memcachedClient = new MemcachedClient(new DefaultConnectionFactory() {
            @Override
            public FailureMode getFailureMode() {
               return failureMode;
            }
View Full Code Here


                };
            }
        }
        return memcachedNodesManager.isEncodeNodeIdInSessionId()
                ? new SuffixLocatorConnectionFactory( memcachedNodesManager, memcachedNodesManager.getSessionIdFormat(), statistics, operationTimeout, maxReconnectDelay )
                : new DefaultConnectionFactory() {
                    @Override
                    public long getOperationTimeout() {
                        return operationTimeout;
                    }
                    @Override
View Full Code Here

    private MemcachedClient createMemcachedClient( final String memcachedNodes, final InetSocketAddress address ) throws IOException, InterruptedException {
        final MemcachedNodesManager nodesManager = MemcachedNodesManager.createFor(memcachedNodes, null, null, _memcachedClientCallback);
        final ConnectionFactory cf = nodesManager.isEncodeNodeIdInSessionId()
            ? new SuffixLocatorConnectionFactory( nodesManager, nodesManager.getSessionIdFormat(), Statistics.create(), 1000, 1000 )
            : new DefaultConnectionFactory();
        final MemcachedClient result = new MemcachedClient( cf, Arrays.asList( address ) );

        // Wait a little bit, so that the memcached client can connect and is ready when test starts
        Thread.sleep( 100 );
View Full Code Here

        }

        final MemcachedNodesManager nodesManager = MemcachedNodesManager.createFor(_memcachedNodes, null, null, _memcachedClientCallback);
        final ConnectionFactory cf = nodesManager.isEncodeNodeIdInSessionId()
            ? new SuffixLocatorConnectionFactory( nodesManager, nodesManager.getSessionIdFormat(), Statistics.create(), 1000, 1000 )
            : new DefaultConnectionFactory();
        _client = new MemcachedClient( cf, Arrays.asList( address ) );

        _httpClient = new DefaultHttpClient();
    }
View Full Code Here

TOP

Related Classes of net.spy.memcached.DefaultConnectionFactory

Copyright © 2018 www.massapicom. 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.