Package org.redisson.tomcat
Class RedissonSessionManager
- java.lang.Object
-
- org.apache.catalina.util.LifecycleBase
-
- org.apache.catalina.util.LifecycleMBeanBase
-
- org.apache.catalina.session.ManagerBase
-
- org.redisson.tomcat.RedissonSessionManager
-
- All Implemented Interfaces:
MBeanRegistration
,org.apache.catalina.JmxEnabled
,org.apache.catalina.Lifecycle
,org.apache.catalina.Manager
public class RedissonSessionManager extends org.apache.catalina.session.ManagerBase
Redisson Session Manager for Apache Tomcat- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RedissonSessionManager.ReadMode
static class
RedissonSessionManager.UpdateMode
-
Field Summary
-
Fields inherited from class org.apache.catalina.session.ManagerBase
duplicates, expiredSessions, maxActive, maxActiveSessions, processExpiresFrequency, processingTime, rejectedSessions, secureRandomAlgorithm, secureRandomClass, secureRandomProvider, sessionCounter, sessionCreationTiming, sessionExpirationTiming, sessionIdGenerator, sessionIdGeneratorClass, sessionMaxAliveTime, sessions, sm, support, TIMING_STATS_CACHE_SIZE
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description RedissonSessionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.redisson.api.RedissonClient
buildClient()
org.apache.catalina.Session
createEmptySession()
org.apache.catalina.Session
createSession(String sessionId)
org.apache.catalina.Session
findSession(String id)
String
getConfigPath()
String
getKeyPrefix()
org.redisson.api.RMap<String,Object>
getMap(String sessionId)
String
getName()
String
getNodeId()
String
getReadMode()
org.redisson.api.RedissonClient
getRedisson()
org.redisson.api.RTopic
getTopic()
String
getUpdateMode()
void
load()
void
remove(org.apache.catalina.Session session, boolean update)
void
setConfigPath(String configPath)
void
setKeyPrefix(String keyPrefix)
void
setReadMode(String readMode)
void
setUpdateMode(String updateMode)
protected void
startInternal()
protected void
stopInternal()
void
store(javax.servlet.http.HttpSession session)
void
unload()
-
Methods inherited from class org.apache.catalina.session.ManagerBase
add, addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, changeSessionId, expireSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContext, getCreationTime, getCreationTimestamp, getDomainInternal, getDuplicates, getEngine, getExpiredSessions, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxActiveSessions, getNewSession, getObjectNameKeyProperties, getProcessExpiresFrequency, getProcessingTime, getRejectedSessions, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, getSession, getSessionAttribute, getSessionAttributeNameFilter, getSessionAttributeNamePattern, getSessionAttributeValueClassNameFilter, getSessionAttributeValueClassNamePattern, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionMaxAliveTime, getThisAccessedTime, getThisAccessedTimestamp, getWarnOnSessionAttributeFilterFailure, initInternal, listSessionIds, processExpires, remove, removePropertyChangeListener, setContext, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setProcessExpiresFrequency, setProcessingTime, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSessionAttributeNameFilter, setSessionAttributeValueClassNameFilter, setSessionCounter, setSessionIdGenerator, setSessionMaxAliveTime, setWarnOnSessionAttributeFilterFailure, toString, updateSessionMaxAliveTime, willAttributeDistribute
-
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
-
-
-
-
Method Detail
-
getNodeId
public String getNodeId()
-
getUpdateMode
public String getUpdateMode()
-
setUpdateMode
public void setUpdateMode(String updateMode)
-
getReadMode
public String getReadMode()
-
setReadMode
public void setReadMode(String readMode)
-
setConfigPath
public void setConfigPath(String configPath)
-
getConfigPath
public String getConfigPath()
-
getKeyPrefix
public String getKeyPrefix()
-
setKeyPrefix
public void setKeyPrefix(String keyPrefix)
-
getName
public String getName()
- Overrides:
getName
in classorg.apache.catalina.session.ManagerBase
-
load
public void load() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
unload
public void unload() throws IOException
- Throws:
IOException
-
createSession
public org.apache.catalina.Session createSession(String sessionId)
- Specified by:
createSession
in interfaceorg.apache.catalina.Manager
- Overrides:
createSession
in classorg.apache.catalina.session.ManagerBase
-
getTopic
public org.redisson.api.RTopic getTopic()
-
findSession
public org.apache.catalina.Session findSession(String id) throws IOException
- Specified by:
findSession
in interfaceorg.apache.catalina.Manager
- Overrides:
findSession
in classorg.apache.catalina.session.ManagerBase
- Throws:
IOException
-
createEmptySession
public org.apache.catalina.Session createEmptySession()
- Specified by:
createEmptySession
in interfaceorg.apache.catalina.Manager
- Overrides:
createEmptySession
in classorg.apache.catalina.session.ManagerBase
-
remove
public void remove(org.apache.catalina.Session session, boolean update)
- Specified by:
remove
in interfaceorg.apache.catalina.Manager
- Overrides:
remove
in classorg.apache.catalina.session.ManagerBase
-
getRedisson
public org.redisson.api.RedissonClient getRedisson()
-
startInternal
protected void startInternal() throws org.apache.catalina.LifecycleException
- Overrides:
startInternal
in classorg.apache.catalina.session.ManagerBase
- Throws:
org.apache.catalina.LifecycleException
-
buildClient
protected org.redisson.api.RedissonClient buildClient() throws org.apache.catalina.LifecycleException
- Throws:
org.apache.catalina.LifecycleException
-
stopInternal
protected void stopInternal() throws org.apache.catalina.LifecycleException
- Overrides:
stopInternal
in classorg.apache.catalina.session.ManagerBase
- Throws:
org.apache.catalina.LifecycleException
-
store
public void store(javax.servlet.http.HttpSession session) throws IOException
- Throws:
IOException
-
-