Package net.spy.memcached

Examples of net.spy.memcached.MemcachedClient


  private final ConnectionFactoryBuilder connectionFactoryBuilder = new ConnectionFactoryBuilder();
  private String servers;

  @Override
  public Object getObject() throws Exception {
    return new MemcachedClient(connectionFactoryBuilder.build(), AddrUtil.getAddresses(servers));
  }
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

        assertEquals( response2.get( paramKey ), paramValue, "The session should still contain the previously stored value." );

    }

    private void waitForReconnect( final MemcachedSessionService service, final MemCacheDaemon<?> value, final long timeToWait ) throws InterruptedException {
        MemcachedClient client;
        InetSocketAddress serverAddress;
        try {
            final Method m = MemcachedSessionService.class.getDeclaredMethod( "getMemcached" );
            m.setAccessible( true );
            client = (MemcachedClient) m.invoke( service );
View Full Code Here

  private MemcachedClient memcached;

  public MemcachedState() {
    try {
      memcached = new MemcachedClient(new InetSocketAddress("localhost", 11211));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    }
  }

  public MemcachedState(String hostname, int portNum) {
    try {
      memcached = new MemcachedClient(new InetSocketAddress(hostname, portNum));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

            ConnectionFactory cf = new ConnectionFactoryBuilder()
                    .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
                    .setAuthDescriptor(ad)
                    .build();

            client = new MemcachedClient(cf, addrs);
        } else {
            client = new MemcachedClient(addrs);
        }
    }
View Full Code Here

  @Override
  protected IDataStore createDataStore() throws Exception {
    IMemcachedSettings settings = new MemcachedSettings();
    // settings.setServerNames("");
    MemcachedClient client = MemcachedDataStore.createClient(settings);
    return new GuavaMemcachedDataStore(client, settings);
  }
View Full Code Here

    for (int i = 0; i < hostnames.size(); i++) {
      String hostname = hostnames.get(i);
      addresses[i] = new InetSocketAddress(hostname, memcachedPort);
    }

    return new MemcachedClient(addresses);
  }
View Full Code Here

    for (int i = 0; i < hostnames.size(); i++) {
      String hostname = hostnames.get(i);
      addresses[i] = new InetSocketAddress(hostname, memcachedPort);
    }

    return new MemcachedClient(addresses);
  }
View Full Code Here

     */
    SimpleEVCacheClientImpl(String appName, int id, int maxQueueSize, DynamicIntProperty readTimeout,
                            List<InetSocketAddress> memcachedNodesInZone) throws IOException {
        super(appName, "GLOBAL", id, maxQueueSize, readTimeout);

        this.client = new MemcachedClient(connectionFactory, memcachedNodesInZone);
    }
View Full Code Here

TOP

Related Classes of net.spy.memcached.MemcachedClient

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.