public class MemcachedSessionDataMap extends AbstractLifeCycle implements SessionDataMap
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
protected net.rubyeye.xmemcached.XMemcachedClientBuilder |
_builder |
protected net.rubyeye.xmemcached.MemcachedClient |
_client |
protected int |
_expirySec |
protected boolean |
_heartbeats |
static String |
DEFAULT_HOST |
static String |
DEFAULT_PORT |
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
Constructor and Description |
---|
MemcachedSessionDataMap(List<InetSocketAddress> addresses) |
MemcachedSessionDataMap(List<InetSocketAddress> addresses,
int[] weights) |
MemcachedSessionDataMap(String host,
String port) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(String id)
Delete session data
|
protected void |
doStop() |
net.rubyeye.xmemcached.XMemcachedClientBuilder |
getBuilder() |
void |
initialize(SessionContext context)
Initialize this data map for the
given context.
|
boolean |
isHeartbeats() |
SessionData |
load(String id)
Read in session data.
|
void |
setExpirySec(int sec) |
void |
setHeartbeats(boolean heartbeats) |
void |
store(String id,
SessionData data)
Store the session data.
|
addLifeCycleListener, doStart, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public static final String DEFAULT_HOST
public static final String DEFAULT_PORT
protected net.rubyeye.xmemcached.MemcachedClient _client
protected int _expirySec
protected boolean _heartbeats
protected net.rubyeye.xmemcached.XMemcachedClientBuilder _builder
public MemcachedSessionDataMap(String host, String port)
host
- address of memcache serverport
- address of memcache serverpublic MemcachedSessionDataMap(List<InetSocketAddress> addresses)
public MemcachedSessionDataMap(List<InetSocketAddress> addresses, int[] weights)
public net.rubyeye.xmemcached.XMemcachedClientBuilder getBuilder()
public void setExpirySec(int sec)
sec
- public boolean isHeartbeats()
public void setHeartbeats(boolean heartbeats)
public void initialize(SessionContext context)
SessionDataMap
initialize
in interface SessionDataMap
context
- context associatedSessionDataMap.initialize(org.eclipse.jetty.server.session.SessionContext)
public SessionData load(String id) throws Exception
SessionDataMap
load
in interface SessionDataMap
id
- identity of session to loadException
- if unable to load session dataSessionDataMap.load(java.lang.String)
public void store(String id, SessionData data) throws Exception
SessionDataMap
store
in interface SessionDataMap
id
- identity of session to storedata
- info of session to storeException
- if unable to write session dataSessionDataMap.store(java.lang.String, org.eclipse.jetty.server.session.SessionData)
public boolean delete(String id) throws Exception
SessionDataMap
delete
in interface SessionDataMap
id
- identity of session to deleteException
- if unable to delete session dataSessionDataMap.delete(java.lang.String)
protected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
Copyright © 1995–2017 Webtide. All rights reserved.