Package net.spy.memcached

Source Code of net.spy.memcached.BinaryConnectionFactory

package net.spy.memcached;

import java.net.SocketAddress;
import java.nio.channels.SocketChannel;

import net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl;
import net.spy.memcached.protocol.binary.BinaryOperationFactory;

/**
* Default connection factory for binary wire protocol connections.
*/
public class BinaryConnectionFactory extends DefaultConnectionFactory {

  /**
   * Create a DefaultConnectionFactory with the default parameters.
   */
  public BinaryConnectionFactory() {
    super();
  }

  /**
   * Create a BinaryConnectionFactory with the given maximum operation
   * queue length, and the given read buffer size.
   */
  public BinaryConnectionFactory(int len, int bufSize) {
    super(len, bufSize);
  }

  /**
   * Construct a BinaryConnectionFactory with the given parameters.
   *
   * @param len the queue length.
   * @param bufSize the buffer size
    * @param hash the algorithm to use for hashing
   */
  public BinaryConnectionFactory(int len, int bufSize, HashAlgorithm hash) {
    super(len, bufSize, hash);
  }

  @Override
  public MemcachedNode createMemcachedNode(SocketAddress sa,
      SocketChannel c, int bufSize) {
    boolean doAuth = false;
    return new BinaryMemcachedNodeImpl(sa, c, bufSize,
      createReadOperationQueue(),
      createWriteOperationQueue(),
      createOperationQueue(),
      getOpQueueMaxBlockTime(),
      doAuth);
  }

  @Override
  public OperationFactory getOperationFactory() {
    return new BinaryOperationFactory();
  }

}
TOP

Related Classes of net.spy.memcached.BinaryConnectionFactory

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.