All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.spy.memcached.BinaryConnectionFactory Maven / Gradle / Ivy

The newest version!
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(String name,
                                           SocketAddress sa,
                                           SocketChannel c, int bufSize) {
    boolean doAuth = false;
    return new BinaryMemcachedNodeImpl(name,
            sa, c, bufSize,
            createReadOperationQueue(),
            createWriteOperationQueue(),
            createOperationQueue(),
            getOpQueueMaxBlockTime(),
            doAuth);
  }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy