public
Description: A simple, asynchronous, single-threaded memcached client written in java.
Homepage: http://code.google.com/p/spymemcached/
Clone URL: git://github.com/dustin/java-memcached-client.git
java-memcached-client / src / main / java / net / spy / memcached / BinaryConnectionFactory.java
100644 55 lines (45 sloc) 1.398 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 hashAlgorithm the algorithm to use for hashing
* @param bufSize the buffer size
* @param qLen the queue length.
*/
public BinaryConnectionFactory(int len, int bufSize, HashAlgorithm hash) {
super(len, bufSize, hash);
}
 
@Override
public MemcachedNode createMemcachedNode(SocketAddress sa,
SocketChannel c, int bufSize) {
return new BinaryMemcachedNodeImpl(sa, c, bufSize,
createReadOperationQueue(),
createWriteOperationQueue(),
createOperationQueue());
}
 
@Override
public OperationFactory getOperationFactory() {
return new BinaryOperationFactory();
}
 
}