Package net.rubyeye.xmemcached

Examples of net.rubyeye.xmemcached.XMemcachedClientBuilder


      }
    } else {
      memcachePort = port.toString();
    }

    MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses(memcacheHostName + ":" + memcachePort));
    builder.setCommandFactory(new BinaryCommandFactory());
    builder.setConnectionPoolSize(100);

    try {
      memcachedClient = builder.build();
      memcachedClient.setOpTimeout(30000);
      SerializingTranscoder st = new SerializingTranscoder(memcacheSize);
      memcachedClient.setTranscoder(st);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


            String address = url.getAddress();
            String backup = url.getParameter(Constants.BACKUP_KEY);
            if (backup != null && backup.length() > 0) {
                address += "," + backup;
            }
            MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses(address));
            final MemcachedClient memcachedClient = builder.build();
            final int expiry = url.getParameter("expiry", 0);
            final String get = url.getParameter("get", "get");
            final String set = url.getParameter("set", Map.class.equals(type) ? "put" : "set");
            final String delete = url.getParameter("delete", Map.class.equals(type) ? "remove" : "delete");
            return new AbstractInvoker<T>(type, url) {
View Full Code Here

 
  public XMemcachedCacheProvider(Properties p) {
    super(p);
   
    try {
      MemcachedClientBuilder builder = new XMemcachedClientBuilder(
          AddrUtil.getAddresses(super.getUrlsProperty()));
      //builder.setCommandFactory(new BinaryCommandFactory());//use binary protocol
      client = builder.build();
     
      timeout = (super.getRequestTimeoutInSecondsProperty() > 0)?super.getRequestTimeoutInSecondsProperty():60;
      xmemcachedCache = new XMemcachedCache(this, client);
    } catch (Exception ex) {
      log.error("Error initiating memcached client: " + ex.getMessage(), ex);
View Full Code Here

TOP

Related Classes of net.rubyeye.xmemcached.XMemcachedClientBuilder

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.