com.couchbase.client
Class CouchbaseMemcachedConnection

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.CouchbaseMemcachedConnection
All Implemented Interfaces:
Reconfigurable, java.lang.Runnable

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

Couchbase implementation of CouchbaseConnection. The behavior of a CouchbaseMemcached connection extends spy's MemcachedConnection by handling reconfiguration events. In a Couchbase deployment scenario, reconfiguration updates may notify the client of nodes to be added to or removed from the cluster. This class provides that functionality by extending the MemcachedConnection and adding a method to handle reconfiguration of a bucket.


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
CouchbaseMemcachedConnection(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 reconfigure(Bucket bucket)
          Call on a configuration update.
 void run()
          Infinitely loop processing IO.
 
Methods inherited from class net.spy.memcached.MemcachedConnection
addObserver, addOperation, addOperation, addOperations, 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

CouchbaseMemcachedConnection

public CouchbaseMemcachedConnection(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

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.