Package net.spy.memcached.auth
Class AuthThreadMonitor
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.auth.AuthThreadMonitor
-
public class AuthThreadMonitor extends SpyObject
This will ensure no more than one AuthThread will exist for a given MemcachedNode.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Object,AuthThread>
nodeMap
-
Constructor Summary
Constructors Constructor Description AuthThreadMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
authConnection(MemcachedConnection conn, OperationFactory opFact, AuthDescriptor authDescriptor, MemcachedNode node)
Authenticate a new connection.protected java.util.Map<java.lang.Object,AuthThread>
getNodeMap()
Returns Map of AuthThread for testing authentication mechanisms for different server versions.void
interruptAllPendingAuth()
Interrupt all pendingAuthThread
s.private void
interruptOldAuth(MemcachedNode nodeToStop)
-
-
-
Field Detail
-
nodeMap
private final java.util.Map<java.lang.Object,AuthThread> nodeMap
-
-
Method Detail
-
authConnection
public void authConnection(MemcachedConnection conn, OperationFactory opFact, AuthDescriptor authDescriptor, MemcachedNode node)
Authenticate a new connection. This is typically used by a MemcachedNode in order to authenticate a connection right after it has been established. If an old, but not yet completed authentication exists this will stop it in order to create a new authentication attempt.- Parameters:
conn
-opFact
-authDescriptor
-node
-
-
interruptAllPendingAuth
public void interruptAllPendingAuth()
Interrupt all pendingAuthThread
s. While shutting down a connection, if there are anyAuthThread
s running, terminate them so that the java process can exit gracefully ( otherwise it will wait infinitely).
-
interruptOldAuth
private void interruptOldAuth(MemcachedNode nodeToStop)
-
getNodeMap
protected java.util.Map<java.lang.Object,AuthThread> getNodeMap()
Returns Map of AuthThread for testing authentication mechanisms for different server versions. It should not be accessed from anywhere else.- Returns:
-
-