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
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 enum 
     
    static enum 
     

    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
     
    protected RedissonClient
     

    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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.apache.catalina.Session session)
     
    protected RedissonClient
     
    org.apache.catalina.Session
     
    org.apache.catalina.Session
    createSession(String sessionId)
     
    org.apache.catalina.Session
     
     
     
    getMap(String sessionId)
     
     
     
     
     
     
     
     
    boolean
     
    boolean
     
    void
     
    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
     
    protected void
     
    protected void
     
    void
    store(jakarta.servlet.http.HttpSession session)
     
    void
     

    Methods inherited from class org.apache.catalina.session.ManagerBase

    addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, expireSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContext, getCreationTime, getCreationTimestamp, getDomainInternal, getDuplicates, getEngine, getExpiredSessions, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxActiveSessions, getNewSession, getNotifyAttributeListenerOnUnchangedValue, getNotifyBindingListenerOnUnchangedValue, getObjectNameKeyProperties, getPersistAuthentication, getProcessExpiresFrequency, getProcessingTime, getRejectedSessions, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, getSession, getSessionActivityCheck, getSessionAttribute, getSessionAttributeNameFilter, getSessionAttributeNamePattern, getSessionAttributeValueClassNameFilter, getSessionAttributeValueClassNamePattern, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionLastAccessAtStart, getSessionMaxAliveTime, getThisAccessedTime, getThisAccessedTimestamp, getWarnOnSessionAttributeFilterFailure, initInternal, listSessionIds, processExpires, remove, removePropertyChangeListener, rotateSessionId, setContext, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setNotifyAttributeListenerOnUnchangedValue, setNotifyBindingListenerOnUnchangedValue, setPersistAuthentication, setProcessExpiresFrequency, setProcessingTime, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSessionActivityCheck, setSessionAttributeNameFilter, setSessionAttributeValueClassNameFilter, setSessionCounter, setSessionIdGenerator, setSessionLastAccessAtStart, setSessionMaxAliveTime, setWarnOnSessionAttributeFilterFailure, toString, updateSessionMaxAliveTime, willAttributeDistribute

    Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase

    destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister

    Methods inherited from class org.apache.catalina.util.LifecycleBase

    addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • RedissonSessionManager

      public RedissonSessionManager()
  • Method Details

    • 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
    • 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 interface org.apache.catalina.Manager
      Overrides:
      createSession in class org.apache.catalina.session.ManagerBase
    • getNotifiedNodes

      public RSet<String> getNotifiedNodes(String sessionId)
    • getMap

      public RMap<String,Object> getMap(String sessionId)
    • 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
    • getRedisson

      public 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 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(jakarta.servlet.http.HttpSession session) throws IOException
      Throws:
      IOException