Class MemcachedSessionDataMap
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.memcached.session.MemcachedSessionDataMap
- All Implemented Interfaces:
org.eclipse.jetty.server.session.SessionDataMap,org.eclipse.jetty.util.component.LifeCycle
@ManagedObject
public class MemcachedSessionDataMap
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements org.eclipse.jetty.server.session.SessionDataMap
MemcachedSessionDataMap
Uses memcached as a cache for SessionData.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSessionDataTranscoder We override memcached deserialization to use our classloader-aware ObjectInputStream.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.rubyeye.xmemcached.XMemcachedClientBuilderprotected net.rubyeye.xmemcached.MemcachedClientprotected org.eclipse.jetty.server.session.SessionContextprotected intprotected booleanstatic final Stringstatic final StringFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPING -
Constructor Summary
ConstructorsConstructorDescriptionMemcachedSessionDataMap(String host, String port) MemcachedSessionDataMap(List<InetSocketAddress> addresses) MemcachedSessionDataMap(List<InetSocketAddress> addresses, int[] weights) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected voiddoStop()net.rubyeye.xmemcached.XMemcachedClientBuilderintExpiry time for memached entries.voidinitialize(org.eclipse.jetty.server.session.SessionContext context) booleanorg.eclipse.jetty.server.session.SessionDatavoidsetExpirySec(int sec) voidsetHeartbeats(boolean heartbeats) voidMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addEventListener, doStart, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Field Details
-
DEFAULT_HOST
- See Also:
-
DEFAULT_PORT
- See Also:
-
_client
protected net.rubyeye.xmemcached.MemcachedClient _client -
_expirySec
protected int _expirySec -
_heartbeats
protected boolean _heartbeats -
_builder
protected net.rubyeye.xmemcached.XMemcachedClientBuilder _builder -
_context
protected org.eclipse.jetty.server.session.SessionContext _context
-
-
Constructor Details
-
MemcachedSessionDataMap
- Parameters:
host- address of memcache serverport- address of memcache server
-
MemcachedSessionDataMap
-
MemcachedSessionDataMap
-
-
Method Details
-
getBuilder
public net.rubyeye.xmemcached.XMemcachedClientBuilder getBuilder()- Returns:
- the builder
-
setExpirySec
public void setExpirySec(int sec) - Parameters:
sec- the expiry to use in seconds
-
getExpirySec
@ManagedAttribute(value="memcached expiry time in sec", readonly=true) public int getExpirySec()Expiry time for memached entries.- Returns:
- memcached expiry time in sec
-
isHeartbeats
@ManagedAttribute(value="enable memcached heartbeats", readonly=true) public boolean isHeartbeats() -
setHeartbeats
public void setHeartbeats(boolean heartbeats) -
initialize
public void initialize(org.eclipse.jetty.server.session.SessionContext context) - Specified by:
initializein interfaceorg.eclipse.jetty.server.session.SessionDataMap
-
load
- Specified by:
loadin interfaceorg.eclipse.jetty.server.session.SessionDataMap- Throws:
Exception
-
store
- Specified by:
storein interfaceorg.eclipse.jetty.server.session.SessionDataMap- Throws:
Exception
-
delete
- Specified by:
deletein interfaceorg.eclipse.jetty.server.session.SessionDataMap- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-