EAF 7.6 Implementation

com.lutris.appserver.server.sessionContainerAdapter
Class JmxContainerAdapterSessionManager

java.lang.Object
  extended by com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager
      extended by com.lutris.appserver.server.sessionContainerAdapter.JmxContainerAdapterSessionManager
All Implemented Interfaces:
com.lutris.appserver.server.session.SessionManager, java.io.Serializable

public class JmxContainerAdapterSessionManager
extends ContainerAdapterSessionManager

Description:

an implementation of ContainerAdapterSessionManager specific to the Tomcat Servlet container. It uses JMX to obtain some data form the Tomcat's session manager, which really manages the sessions

Version:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager
CFG_ENCODE_FIRST_URL, CFG_ENCODE_URL_STATE, defaultEncodeUrlState, defaultMaxSessionIdleTime, encodeFirstUrl, encodeUrlState, maxSessionIdleTime, SESSION
 
Fields inherited from interface com.lutris.appserver.server.session.SessionManager
ENCODE_URL_ALWAYS, ENCODE_URL_AUTO, ENCODE_URL_NEVER
 
Constructor Summary
JmxContainerAdapterSessionManager(com.lutris.appserver.server.Application application, com.lutris.util.Config config, com.lutris.logging.LogChannel logger)
           
 
Method Summary
 int activeSessionCount()
          Gets the number of currently active sessions.
 com.lutris.appserver.server.session.Session createSession(HttpPresentationComms comms)
          Creates a new session
 void deleteSession(com.lutris.appserver.server.session.Session SessionId)
          Delete existing session
 void deleteSession(java.lang.String SessionId)
          Delete existing session
 int expiredSessionCount()
           
 void expireSession(java.lang.String SessionId)
          Expires the session identified by the SessionId
 java.lang.String getLastAccessTime(java.lang.String SessionId)
          The last time when this session has been accessed
 com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1, java.lang.String sessionId, HttpPresentationComms comms)
          Returns teh session object corresponding to the HttpPresentationComms
 java.util.Enumeration getSessionKeys()
          Get all of the active sessions Keys.
 void initialize()
           
 int maxSessionCount()
          Gets the maximum number of concurent sessions that existed at any time
 void resetMaxSessionCount()
          Reset the maximum session count.
 boolean sessionExists(java.lang.String sessionId)
          Returns true if the session identified by sessionId exists
 void shutdown()
          NOP
 
Methods inherited from class com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager
createSession, createSession, getEmptySessionPath, getEncodeFirstUrl, getEncodeUrlState, getSession, getSession, getSession, getSession, getSessionKeys, maxSessionCountDate, passivateSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxContainerAdapterSessionManager

public JmxContainerAdapterSessionManager(com.lutris.appserver.server.Application application,
                                         com.lutris.util.Config config,
                                         com.lutris.logging.LogChannel logger)
                                  throws com.lutris.appserver.server.session.SessionException
Parameters:
application - application that uses this session manager
config - application's config object
logger - ignored
Throws:
com.lutris.appserver.server.session.SessionException
Method Detail

createSession

public com.lutris.appserver.server.session.Session createSession(HttpPresentationComms comms)
                                                          throws com.lutris.appserver.server.session.SessionException
Creates a new session

Specified by:
createSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
createSession in class ContainerAdapterSessionManager
Parameters:
comms - HttpPresentationComms that containes the HttpServletRequest
Returns:
Seession
Throws:
com.lutris.appserver.server.session.SessionException

getSession

public com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1,
                                                              java.lang.String sessionId,
                                                              HttpPresentationComms comms)
                                                       throws com.lutris.appserver.server.session.SessionException
Returns teh session object corresponding to the HttpPresentationComms

Specified by:
getSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSession in class ContainerAdapterSessionManager
Parameters:
parm1 - ignored
sessionId - ignored
comms - HttpPresentationComms object that contains HttpServletRequest from which the session is extracted
Returns:
the Session object
Throws:
com.lutris.appserver.server.session.SessionException

deleteSession

public void deleteSession(com.lutris.appserver.server.session.Session SessionId)
                   throws com.lutris.appserver.server.session.SessionException
Delete existing session

Specified by:
deleteSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
deleteSession in class ContainerAdapterSessionManager
Throws:
com.lutris.appserver.server.session.SessionException

deleteSession

public void deleteSession(java.lang.String SessionId)
                   throws com.lutris.appserver.server.session.SessionException
Delete existing session

Specified by:
deleteSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
deleteSession in class ContainerAdapterSessionManager
Throws:
com.lutris.appserver.server.session.SessionException

sessionExists

public boolean sessionExists(java.lang.String sessionId)
                      throws com.lutris.appserver.server.session.SessionException
Returns true if the session identified by sessionId exists

Specified by:
sessionExists in interface com.lutris.appserver.server.session.SessionManager
Overrides:
sessionExists in class ContainerAdapterSessionManager
Parameters:
sessionId - the identification of the session
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

getSessionKeys

public java.util.Enumeration getSessionKeys()
                                     throws com.lutris.appserver.server.session.SessionException
Get all of the active sessions Keys.

Specified by:
getSessionKeys in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSessionKeys in class ContainerAdapterSessionManager
Returns:
An enumeration of the active sessions Keys.
Throws:
com.lutris.appserver.server.session.SessionException - If the sessions cannot be retrieved.

getLastAccessTime

public java.lang.String getLastAccessTime(java.lang.String SessionId)
                                   throws com.lutris.appserver.server.session.SessionException
The last time when this session has been accessed

Parameters:
SessionId - session key
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

expireSession

public void expireSession(java.lang.String SessionId)
                   throws com.lutris.appserver.server.session.SessionException
Expires the session identified by the SessionId

Parameters:
SessionId - - session key
Throws:
com.lutris.appserver.server.session.SessionException

maxSessionCount

public int maxSessionCount()
Gets the maximum number of concurent sessions that existed at any time

Specified by:
maxSessionCount in interface com.lutris.appserver.server.session.SessionManager
Overrides:
maxSessionCount in class ContainerAdapterSessionManager
Returns:
The number of sessions, or -1.

expiredSessionCount

public int expiredSessionCount()
                        throws com.lutris.appserver.server.session.SessionException
Returns:
the number of expired sessions (not including the sessions forced to expire), or -1 if it can not be determined
Throws:
com.lutris.appserver.server.session.SessionException

activeSessionCount

public int activeSessionCount()
                       throws com.lutris.appserver.server.session.SessionException
Gets the number of currently active sessions.

Specified by:
activeSessionCount in interface com.lutris.appserver.server.session.SessionManager
Overrides:
activeSessionCount in class ContainerAdapterSessionManager
Returns:
The number of currently active sessions.
Throws:
com.lutris.appserver.server.session.SessionException

resetMaxSessionCount

public void resetMaxSessionCount()
                          throws com.lutris.appserver.server.session.SessionException
Reset the maximum session count. See maxSessionCount(). The highwater mark should be reset to the current number of sessions.

Specified by:
resetMaxSessionCount in interface com.lutris.appserver.server.session.SessionManager
Overrides:
resetMaxSessionCount in class ContainerAdapterSessionManager
Throws:
com.lutris.appserver.server.session.SessionException - if the max session count cannot be reset.

initialize

public void initialize()
                throws com.lutris.appserver.server.session.SessionException
Throws:
com.lutris.appserver.server.session.SessionException

shutdown

public void shutdown()
Description copied from class: ContainerAdapterSessionManager
NOP

Specified by:
shutdown in interface com.lutris.appserver.server.session.SessionManager
Overrides:
shutdown in class ContainerAdapterSessionManager

EAF 7.6 Implementation