com.couchbase.client
Class CouchbaseConnection

java.lang.Object
  extended by java.lang.Thread
      extended by net.spy.memcached.compat.SpyThread
          extended by net.spy.memcached.MemcachedConnection
              extended by com.couchbase.client.CouchbaseConnection
All Implemented Interfaces:
Reconfigurable, java.lang.Runnable

public class CouchbaseConnection
extends net.spy.memcached.MemcachedConnection
implements Reconfigurable

Maintains connections to each node in a cluster of Couchbase Nodes.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean reconfiguring
           
 
Fields inherited from class net.spy.memcached.MemcachedConnection
addedQueue, failureMode, locator, nodesToShutdown, running, selector, shutDown
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CouchbaseConnection(int bufSize, CouchbaseConnectionFactory f, java.util.List<java.net.InetSocketAddress> a, java.util.Collection<net.spy.memcached.ConnectionObserver> obs, net.spy.memcached.FailureMode fm, net.spy.memcached.OperationFactory opfactory)
           
 
Method Summary
 void addOperation(java.lang.String key, net.spy.memcached.ops.Operation o)
          Add an operation to the given connection.
 void addOperations(java.util.Map<net.spy.memcached.MemcachedNode,net.spy.memcached.ops.Operation> ops)
           
 void reconfigure(Bucket bucket)
          Call on a configuration update.
 void run()
          Infinitely loop processing IO.
 
Methods inherited from class net.spy.memcached.MemcachedConnection
addObserver, addOperation, broadcastOperation, broadcastOperation, checkState, createConnections, enqueueOperation, getLocator, handleIO, insertOperation, opSucceeded, opTimedOut, queueReconnect, removeObserver, shutdown, toString
 
Methods inherited from class net.spy.memcached.compat.SpyThread
getLogger
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reconfiguring

protected volatile boolean reconfiguring
Constructor Detail

CouchbaseConnection

public CouchbaseConnection(int bufSize,
                           CouchbaseConnectionFactory f,
                           java.util.List<java.net.InetSocketAddress> a,
                           java.util.Collection<net.spy.memcached.ConnectionObserver> obs,
                           net.spy.memcached.FailureMode fm,
                           net.spy.memcached.OperationFactory opfactory)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

reconfigure

public void reconfigure(Bucket bucket)
Description copied from interface: Reconfigurable
Call on a configuration update.

Specified by:
reconfigure in interface Reconfigurable
Parameters:
bucket - updated vbucket configuration

addOperation

public void addOperation(java.lang.String key,
                         net.spy.memcached.ops.Operation o)
Add an operation to the given connection.

Overrides:
addOperation in class net.spy.memcached.MemcachedConnection
Parameters:
key - the key the operation is operating upon
o - the operation

addOperations

public void addOperations(java.util.Map<net.spy.memcached.MemcachedNode,net.spy.memcached.ops.Operation> ops)
Overrides:
addOperations in class net.spy.memcached.MemcachedConnection

run

public void run()
Infinitely loop processing IO.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class net.spy.memcached.MemcachedConnection


Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.