Class RedissonSessionManager

  • All Implemented Interfaces:
    MBeanRegistration, org.apache.catalina.JmxEnabled, org.apache.catalina.Lifecycle, org.apache.catalina.Manager
    Direct Known Subclasses:
    JndiRedissonSessionManager

    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 
      Modifier and Type Field Description
      protected String keyPrefix  
      protected RedissonClient redisson  
      • 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
      void add​(org.apache.catalina.Session session)  
      protected 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()  
      RMap<String,​Object> getMap​(String sessionId)  
      String getName()  
      String getNodeId()  
      RSet<String> getNotifiedNodes​(String sessionId)  
      String getReadMode()  
      RedissonClient getRedisson()  
      RTopic getTopic()  
      String getUpdateMode()  
      boolean isBroadcastSessionEvents()  
      boolean isBroadcastSessionUpdates()  
      void load()  
      void remove​(org.apache.catalina.Session session, boolean update)  
      void setBroadcastSessionEvents​(boolean replicateSessionEvents)  
      void setBroadcastSessionUpdates​(boolean broadcastSessionUpdates)  
      void setConfigPath​(String configPath)  
      void setKeyPrefix​(String keyPrefix)  
      void setReadMode​(String readMode)  
      void setUpdateMode​(String updateMode)  
      protected void shutdownRedisson()  
      protected void startInternal()  
      protected void stopInternal()  
      void store​(javax.servlet.http.HttpSession session)  
      void unload()  
      • Methods inherited from class org.apache.catalina.session.ManagerBase

        addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, changeSessionId, expireSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContext, getCreationTime, getCreationTimestamp, getDomainInternal, getDuplicates, getEngine, getExpiredSessions, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxActiveSessions, getNewSession, getObjectNameKeyProperties, getPersistAuthentication, 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, rotateSessionId, setContext, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setPersistAuthentication, 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, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
    • Constructor Detail

      • RedissonSessionManager

        public RedissonSessionManager()
    • Method Detail

      • getNodeId

        public String getNodeId()
      • getUpdateMode

        public String getUpdateMode()
      • setUpdateMode

        public void setUpdateMode​(String updateMode)
      • isBroadcastSessionEvents

        public boolean isBroadcastSessionEvents()
      • setBroadcastSessionEvents

        public void setBroadcastSessionEvents​(boolean replicateSessionEvents)
      • isBroadcastSessionUpdates

        public boolean isBroadcastSessionUpdates()
      • setBroadcastSessionUpdates

        public void setBroadcastSessionUpdates​(boolean broadcastSessionUpdates)
      • 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 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
      • add

        public void add​(org.apache.catalina.Session session)
        Specified by:
        add in interface org.apache.catalina.Manager
        Overrides:
        add in class org.apache.catalina.session.ManagerBase
      • 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 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
      • shutdownRedisson

        protected void shutdownRedisson()
      • store

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