public void addStateListener(MemcachedClientStateListener listener) { MemcachedClientStateListenerAdapter adapter = new MemcachedClientStateListenerAdapter(listener, this); this.stateListenerAdapters.add(adapter); this.connector.addStateListener(adapter); }
public MemcachedConnector(Configuration configuration, MemcachedSessionLocator locator, BufferAllocator allocator, CommandFactory commandFactory, int poolSize, int maxQueuedNoReplyOperations) { super(configuration, null); this.sessionLocator = locator; this.protocol = commandFactory.getProtocol(); this.addStateListener(new InnerControllerStateListener()); this.updateSessions(); this.bufferAllocator = allocator; this.optimiezer = new Optimizer(this.protocol); this.optimiezer.setBufferAllocator(this.bufferAllocator); this.connectionPoolSize = poolSize; this.soLingerOn = true; this.commandFactory = commandFactory; this.flowControl = new FlowControl(maxQueuedNoReplyOperations); this.setSelectorPoolSize(configuration.getSelectorPoolSize()); // setDispatchMessageThreadPoolSize(Runtime.getRuntime(). // availableProcessors()); }
public void addStateListener(MemcachedClientStateListener listener) { MemcachedClientStateListenerAdapter adapter = new MemcachedClientStateListenerAdapter(listener, this); this.stateListenerAdapters.add(adapter); this.connector.addStateListener(adapter); }
public MemcachedConnector(Configuration configuration, MemcachedSessionLocator locator, BufferAllocator allocator, CommandFactory commandFactory, int poolSize, int maxQueuedNoReplyOperations) { super(configuration, null); this.sessionLocator = locator; this.protocol = commandFactory.getProtocol(); this.addStateListener(new InnerControllerStateListener()); this.updateSessions(); this.bufferAllocator = allocator; this.optimiezer = new Optimizer(this.protocol); this.optimiezer.setBufferAllocator(this.bufferAllocator); this.connectionPoolSize = poolSize; this.soLingerOn = true; this.commandFactory = commandFactory; this.flowControl = new FlowControl(maxQueuedNoReplyOperations); this.setSelectorPoolSize(configuration.getSelectorPoolSize()); // setDispatchMessageThreadPoolSize(Runtime.getRuntime(). // availableProcessors()); }