public class TapConnectionProvider extends SpyObject implements ConnectionObserver
Modifier and Type | Field and Description |
---|---|
protected AuthDescriptor |
authDescriptor |
protected AuthThreadMonitor |
authMonitor |
protected MemcachedConnection |
conn |
protected OperationFactory |
opFact |
protected boolean |
shuttingDown |
protected TranscodeService |
tcService |
Constructor and Description |
---|
TapConnectionProvider(ConnectionFactory cf,
java.util.List<java.net.InetSocketAddress> addrs)
Get a tap client operating on the specified memcached locations.
|
TapConnectionProvider(java.net.InetSocketAddress... ia)
Get a tap client operating on the specified memcached locations.
|
TapConnectionProvider(java.util.List<java.net.InetSocketAddress> addrs)
Get a tap client operating on the specified memcached locations.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addObserver(ConnectionObserver obs)
Add a connection observer.
|
void |
addTapAckOp(MemcachedNode node,
Operation op) |
java.util.concurrent.CountDownLatch |
broadcastOp(BroadcastOpFactory of) |
void |
connectionEstablished(java.net.SocketAddress sa,
int reconnectCount)
A connection has just successfully been established on the given socket.
|
void |
connectionLost(java.net.SocketAddress sa)
A connection was just lost on the given socket.
|
OperationFactory |
getOpFactory() |
boolean |
removeObserver(ConnectionObserver obs)
Remove a connection observer.
|
void |
shutdown()
Shut down immediately.
|
boolean |
shutdown(long timeout,
java.util.concurrent.TimeUnit unit)
Shut down this client gracefully.
|
boolean |
waitForQueues(long timeout,
java.util.concurrent.TimeUnit unit)
Wait for the queues to die down.
|
protected volatile boolean shuttingDown
protected final MemcachedConnection conn
protected final OperationFactory opFact
protected final TranscodeService tcService
protected final AuthDescriptor authDescriptor
protected final AuthThreadMonitor authMonitor
public TapConnectionProvider(java.net.InetSocketAddress... ia) throws java.io.IOException
ia
- the memcached locationsjava.io.IOException
- if connections cannot be establishedpublic TapConnectionProvider(java.util.List<java.net.InetSocketAddress> addrs) throws java.io.IOException
addrs
- the socket addrsjava.io.IOException
- if connections cannot be establishedpublic TapConnectionProvider(ConnectionFactory cf, java.util.List<java.net.InetSocketAddress> addrs) throws java.io.IOException
cf
- the connection factory to configure connections for this clientaddrs
- the socket addressesjava.io.IOException
- if connections cannot be establishedpublic void addTapAckOp(MemcachedNode node, Operation op)
public java.util.concurrent.CountDownLatch broadcastOp(BroadcastOpFactory of)
public boolean addObserver(ConnectionObserver obs)
obs
- the ConnectionObserver you wish to addpublic boolean removeObserver(ConnectionObserver obs)
obs
- the ConnectionObserver you wish to addpublic void connectionEstablished(java.net.SocketAddress sa, int reconnectCount)
ConnectionObserver
connectionEstablished
in interface ConnectionObserver
sa
- the address of the node whose connection was establishedreconnectCount
- the number of attempts before the connection was
establishedpublic void connectionLost(java.net.SocketAddress sa)
ConnectionObserver
connectionLost
in interface ConnectionObserver
sa
- the address of the node whose connection was lostpublic void shutdown()
public boolean shutdown(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- the amount of time for shutdownunit
- the TimeUnit for the timeoutpublic boolean waitForQueues(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- the amount of time time for shutdownunit
- the TimeUnit for the timeoutjava.lang.IllegalStateException
- in the rare circumstance where queue is too
full to accept any more requestspublic OperationFactory getOpFactory()
Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.