Sessions in Enhydra Enterprise Server


Table of Contents

1. Sessions in Enhydra Enterprise Server

Chapter 1. Sessions in Enhydra Enterprise Server

Sessions in Enhydra Enterprise Server should be managed by the servlet container, the session data is being stored in the HttpSession object. To achieve this, and to improve the flexibility of the enhydra framework, different implementations of the session manager have been developed. The class that implements the one used with each of the applications is to be stated in the configuration file, for example:

SessionManager.Class=com.lutris.appserver.server.sessionEnhydra.SimpleServletSessionManager

If the SessionManager.Class is not specified, the old com.lutris.appserver.server.sessionEnhydra.StandardSessionManager is used (it is kept for compatibility reasons, but it's use is not encouraged).

The available session manager adapters are:

  • com.lutris.appserver.server.sessionEnhydra. SimpleServletSessionManager - this is a simple session manager which interconnects the servlet container sessions and enhydra sessions by using the same session keys (generated by session container).

  • com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager - Simple session manager to be used with servlet container capable of managing their sessions. It uses HttpSession to keep the session data. The sessions are completely managed by the session container and are configured in the servlet container configuration files. Any session configuration parameters defined in the application configuration file are ignored (except sessionManager.Class, sessionManager.MaxIdleTime and sessionManager.SessionEncodeUrlState). The persistence across restarts of the application and container is relised by the appropriate servlet container mechanisms.

  • com.lutris.appserver.server.sessionContainerAdapter.TomcatContainerAdapterSessionManager - Tomcat specific session manager, extends ContainerAdapterSessionManager, witch interacts directly with (wraps) Tomcat Session Manager (configured in the servlet container configuration files) to enable management from application. Supported configuration parameters (defined in the application configuration file) are: sessionManager.Class , sessionManager.MaxIdleTime, sessionManager.SessionEncodeUrlState, sessionManager.SessionHome.SaveOnRestart and sessionManager.SessionHome.MaxSessions.

  • com.lutris.appserver.server.sessionContainerAdapter.JmxContainerAdapterSessionManager - Tomcat specific session manager, extends ContainerAdapterSessionManager, by using JMX MBeans to obtain some session information from the session container. Supported configuration parameters (defined in the application configuration file) are: sessionManager.Class , sessionManager.MaxIdleTime, sessionManager.SessionEncodeUrlState, sessionManager.SessionHome.SaveOnRestart and sessionManager.SessionHome.MaxSessions.

NOTE: for the latter tree containers, session data must be serializable in order to fully utilize the persistence obtained by the session container.