Package net.rubyeye.xmemcached.impl
Class RandomMemcachedSessionLocaltor
- java.lang.Object
-
- net.rubyeye.xmemcached.impl.RandomMemcachedSessionLocaltor
-
- All Implemented Interfaces:
MemcachedSessionLocator
public class RandomMemcachedSessionLocaltor extends java.lang.Object implements MemcachedSessionLocator
A random session locator,it can be used in kestrel.
-
-
Constructor Summary
Constructors Constructor Description RandomMemcachedSessionLocaltor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessiongetSessionByKey(java.lang.String key)Returns a session by special key.voidsetFailureMode(boolean failureMode)Configure failure modevoidupdateSessions(java.util.Collection<Session> list)Update sessions when session was added or removed.
-
-
-
Field Detail
-
sessions
private transient volatile java.util.List<Session> sessions
-
rand
private final java.util.Random rand
-
-
Method Detail
-
getSessionByKey
public Session getSessionByKey(java.lang.String key)
Description copied from interface:MemcachedSessionLocatorReturns a session by special key.- Specified by:
getSessionByKeyin interfaceMemcachedSessionLocator- Returns:
-
updateSessions
public void updateSessions(java.util.Collection<Session> list)
Description copied from interface:MemcachedSessionLocatorUpdate sessions when session was added or removed.- Specified by:
updateSessionsin interfaceMemcachedSessionLocator- Parameters:
list- The newer sessions
-
setFailureMode
public void setFailureMode(boolean failureMode)
Description copied from interface:MemcachedSessionLocatorConfigure failure mode- Specified by:
setFailureModein interfaceMemcachedSessionLocator- Parameters:
failureMode- true is using failure mode
-
-