Class 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  
      • Nested classes/interfaces inherited from class org.apache.catalina.session.ManagerBase

        org.apache.catalina.session.ManagerBase.SessionTiming
      • Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

        org.apache.catalina.Lifecycle.SingleUse
    • 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 class org.apache.catalina.util.LifecycleMBeanBase

        mserver
      • 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
    • 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
      • Methods inherited from class org.apache.catalina.util.LifecycleBase

        addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop
    • Constructor Detail

      • RedissonSessionManager

        public RedissonSessionManager()
    • 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 class org.apache.catalina.session.ManagerBase
      • createSession

        public org.apache.catalina.Session createSession​(String sessionId)
        Specified by:
        createSession in interface org.apache.catalina.Manager
        Overrides:
        createSession in class org.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 interface org.apache.catalina.Manager
        Overrides:
        findSession in class org.apache.catalina.session.ManagerBase
        Throws:
        IOException
      • createEmptySession

        public org.apache.catalina.Session createEmptySession()
        Specified by:
        createEmptySession in interface org.apache.catalina.Manager
        Overrides:
        createEmptySession in class org.apache.catalina.session.ManagerBase
      • remove

        public void remove​(org.apache.catalina.Session session,
                           boolean update)
        Specified by:
        remove in interface org.apache.catalina.Manager
        Overrides:
        remove in class org.apache.catalina.session.ManagerBase
      • getRedisson

        public org.redisson.api.RedissonClient getRedisson()
      • startInternal

        protected void startInternal()
                              throws org.apache.catalina.LifecycleException
        Overrides:
        startInternal in class org.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 class org.apache.catalina.session.ManagerBase
        Throws:
        org.apache.catalina.LifecycleException
      • store

        public void store​(javax.servlet.http.HttpSession session)
                   throws IOException
        Throws:
        IOException