org.mortbay.j2ee.session
Class Manager

java.lang.Object
  extended by org.mortbay.j2ee.session.Manager
All Implemented Interfaces:
org.eclipse.jetty.server.SessionManager, org.eclipse.jetty.util.component.LifeCycle

public class Manager
extends Object
implements org.eclipse.jetty.server.SessionManager


Nested Class Summary
static interface Manager.Session
           
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
 
Field Summary
protected  boolean _checkingRemoteSessionIdEncoding
           
protected  org.eclipse.jetty.webapp.WebAppContext _context
           
protected  org.eclipse.jetty.server.session.SessionHandler _handler
           
protected  IdGenerator _idGenerator
           
protected  StateInterceptor[] _interceptorStack
           
protected  int _maxInactiveInterval
           
protected  int _scavengerPeriod
           
protected  Store _store
           
protected  boolean _usingCookies
          Whether or not the session manager will use cookies or URLs only.
 
Fields inherited from interface org.eclipse.jetty.server.SessionManager
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
 
Constructor Summary
Manager()
           
 
Method Summary
 org.eclipse.jetty.http.HttpCookie access(javax.servlet.http.HttpSession arg0, boolean secure)
           
 void addEventListener(EventListener listener)
           
 void addLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener arg0)
           
 void clearEventListeners()
           
 Object clone()
           
 void complete(javax.servlet.http.HttpSession arg0)
           
 long currentSecond()
           
protected  State destroyContainer(javax.servlet.http.HttpSession session)
           
protected  void destroySession(javax.servlet.http.HttpSession container)
           
protected  javax.servlet.http.HttpSession findSession(String id, boolean create)
           
 String getClusterId(javax.servlet.http.HttpSession session)
           
 org.eclipse.jetty.webapp.WebAppContext getContext()
           
 String getContextPath()
           
 boolean getCrossContextSessionIDs()
           
 boolean getHttpOnly()
           
 javax.servlet.http.HttpSession getHttpSession(String id)
           
 IdGenerator getIdGenerator()
           
 org.eclipse.jetty.server.SessionIdManager getIdManager()
           
 StateInterceptor[] getInterceptorStack()
           
 int getMaxCookieAge()
           
 int getMaxInactiveInterval()
           
 org.eclipse.jetty.server.SessionIdManager getMetaManager()
           
 String getNodeId(javax.servlet.http.HttpSession session)
           
 int getScavengerPeriod()
           
 boolean getSecureCookies()
           
 javax.servlet.ServletContext getServletContext()
           
 javax.servlet.http.HttpSessionContext getSessionContext()
           
 String getSessionCookie()
           
 org.eclipse.jetty.http.HttpCookie getSessionCookie(javax.servlet.http.HttpSession session, String contextPath, boolean requestIsSecure)
           
 String getSessionDomain()
           
 org.eclipse.jetty.server.SessionIdManager getSessionIdManager()
           
 String getSessionIdPathParameterName()
           
 String getSessionIdPathParameterNamePrefix()
           
 String getSessionPath()
           
 String getSessionURL()
           
 String getSessionURLPrefix()
           
 Store getStore()
           
 boolean isCheckingRemoteSessionIdEncoding()
           
 boolean isFailed()
           
 boolean isRunning()
           
 boolean isStarted()
           
 boolean isStarting()
           
 boolean isStopped()
           
 boolean isStopping()
           
 boolean isUsingCookies()
           
 boolean isValid(javax.servlet.http.HttpSession session)
           
protected  javax.servlet.http.HttpSession newContainer(String id, State state)
           
 javax.servlet.http.HttpSession newHttpSession(javax.servlet.http.HttpServletRequest request)
           
protected  Manager.Session newSession(javax.servlet.http.HttpServletRequest request)
           
 Object notifyAttributeAdded(javax.servlet.http.HttpSession session, String name, Object value)
           
 Object notifyAttributeRemoved(javax.servlet.http.HttpSession session, String name, Object value)
           
 Object notifyAttributeReplaced(javax.servlet.http.HttpSession session, String name, Object value)
           
 void notifySessionCreated(javax.servlet.http.HttpSession session)
           
 void notifySessionDestroyed(javax.servlet.http.HttpSession session)
           
 void removeEventListener(EventListener listener)
           
 void removeLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener arg0)
           
protected  void scavenge()
           
 boolean sessionExists(String id)
           
 void setCheckingRemoteSessionIdEncoding(boolean checking)
           
 void setContext(org.eclipse.jetty.webapp.WebAppContext context)
           
 void setCrossContextSessionIDs(boolean useRequestedId)
          Set Cross Context sessions IDs This option activates a mode where a requested session ID can be used to create a new session.
 void setIdGenerator(IdGenerator idGenerator)
           
 void setIdManager(org.eclipse.jetty.server.SessionIdManager arg0)
           
 void setInterceptorStack(StateInterceptor[] interceptorStack)
           
 void setMaxCookieAge(int arg0)
           
 void setMaxInactiveInterval(int seconds)
           
 void setScavengerPeriod(int period)
           
 void setSessionCookie(String arg0)
           
 void setSessionDomain(String arg0)
           
 void setSessionHandler(org.eclipse.jetty.server.session.SessionHandler handler)
           
 void setSessionIdManager(org.eclipse.jetty.server.SessionIdManager idManager)
           
 void setSessionIdPathParameterName(String parameterName)
           
 void setSessionPath(String arg0)
           
 void setSessionURL(String arg0)
           
 void setStore(Store store)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_context

protected org.eclipse.jetty.webapp.WebAppContext _context

_usingCookies

protected boolean _usingCookies
Whether or not the session manager will use cookies or URLs only.


_checkingRemoteSessionIdEncoding

protected boolean _checkingRemoteSessionIdEncoding

_scavengerPeriod

protected int _scavengerPeriod

_interceptorStack

protected StateInterceptor[] _interceptorStack

_idGenerator

protected IdGenerator _idGenerator

_maxInactiveInterval

protected int _maxInactiveInterval

_store

protected Store _store

_handler

protected org.eclipse.jetty.server.session.SessionHandler _handler
Constructor Detail

Manager

public Manager()
Method Detail

getContext

public org.eclipse.jetty.webapp.WebAppContext getContext()

setContext

public void setContext(org.eclipse.jetty.webapp.WebAppContext context)

setScavengerPeriod

public void setScavengerPeriod(int period)

getScavengerPeriod

public int getScavengerPeriod()

setCheckingRemoteSessionIdEncoding

public void setCheckingRemoteSessionIdEncoding(boolean checking)
Specified by:
setCheckingRemoteSessionIdEncoding in interface org.eclipse.jetty.server.SessionManager

isCheckingRemoteSessionIdEncoding

public boolean isCheckingRemoteSessionIdEncoding()
Specified by:
isCheckingRemoteSessionIdEncoding in interface org.eclipse.jetty.server.SessionManager

getInterceptorStack

public StateInterceptor[] getInterceptorStack()

setInterceptorStack

public void setInterceptorStack(StateInterceptor[] interceptorStack)

getIdGenerator

public IdGenerator getIdGenerator()

setIdGenerator

public void setIdGenerator(IdGenerator idGenerator)

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface org.eclipse.jetty.server.SessionManager

setMaxInactiveInterval

public void setMaxInactiveInterval(int seconds)
Specified by:
setMaxInactiveInterval in interface org.eclipse.jetty.server.SessionManager

getStore

public Store getStore()

setStore

public void setStore(Store store)

clone

public Object clone()
Overrides:
clone in class Object

getContextPath

public String getContextPath()

start

public void start()
Specified by:
start in interface org.eclipse.jetty.util.component.LifeCycle

isStarted

public boolean isStarted()
Specified by:
isStarted in interface org.eclipse.jetty.util.component.LifeCycle

stop

public void stop()
Specified by:
stop in interface org.eclipse.jetty.util.component.LifeCycle

setSessionHandler

public void setSessionHandler(org.eclipse.jetty.server.session.SessionHandler handler)
Specified by:
setSessionHandler in interface org.eclipse.jetty.server.SessionManager

getHttpSession

public javax.servlet.http.HttpSession getHttpSession(String id)
Specified by:
getHttpSession in interface org.eclipse.jetty.server.SessionManager

sessionExists

public boolean sessionExists(String id)

newHttpSession

public javax.servlet.http.HttpSession newHttpSession(javax.servlet.http.HttpServletRequest request)
Specified by:
newHttpSession in interface org.eclipse.jetty.server.SessionManager

addEventListener

public void addEventListener(EventListener listener)
                      throws IllegalArgumentException,
                             IllegalStateException
Specified by:
addEventListener in interface org.eclipse.jetty.server.SessionManager
Throws:
IllegalArgumentException
IllegalStateException

clearEventListeners

public void clearEventListeners()
Specified by:
clearEventListeners in interface org.eclipse.jetty.server.SessionManager

removeEventListener

public void removeEventListener(EventListener listener)
                         throws IllegalStateException
Specified by:
removeEventListener in interface org.eclipse.jetty.server.SessionManager
Throws:
IllegalStateException

getServletContext

public javax.servlet.ServletContext getServletContext()

getSessionContext

public javax.servlet.http.HttpSessionContext getSessionContext()

newContainer

protected javax.servlet.http.HttpSession newContainer(String id,
                                                      State state)

newSession

protected Manager.Session newSession(javax.servlet.http.HttpServletRequest request)

destroyContainer

protected State destroyContainer(javax.servlet.http.HttpSession session)

destroySession

protected void destroySession(javax.servlet.http.HttpSession container)

findSession

protected javax.servlet.http.HttpSession findSession(String id,
                                                     boolean create)

notifyAttributeAdded

public Object notifyAttributeAdded(javax.servlet.http.HttpSession session,
                                   String name,
                                   Object value)

notifyAttributeReplaced

public Object notifyAttributeReplaced(javax.servlet.http.HttpSession session,
                                      String name,
                                      Object value)

notifyAttributeRemoved

public Object notifyAttributeRemoved(javax.servlet.http.HttpSession session,
                                     String name,
                                     Object value)

notifySessionCreated

public void notifySessionCreated(javax.servlet.http.HttpSession session)

notifySessionDestroyed

public void notifySessionDestroyed(javax.servlet.http.HttpSession session)

currentSecond

public long currentSecond()

scavenge

protected void scavenge()

getCrossContextSessionIDs

public boolean getCrossContextSessionIDs()
Returns:
True if cross context session IDs are first considered for new session IDs

setCrossContextSessionIDs

public void setCrossContextSessionIDs(boolean useRequestedId)
Set Cross Context sessions IDs This option activates a mode where a requested session ID can be used to create a new session. This facilitates the sharing of session cookies when cross context dispatches use sessions.

Parameters:
useRequestedId - True if cross context session ID are first considered for new session IDs

getSessionCookie

public org.eclipse.jetty.http.HttpCookie getSessionCookie(javax.servlet.http.HttpSession session,
                                                          String contextPath,
                                                          boolean requestIsSecure)
Specified by:
getSessionCookie in interface org.eclipse.jetty.server.SessionManager

isStarting

public boolean isStarting()
Specified by:
isStarting in interface org.eclipse.jetty.util.component.LifeCycle

getMetaManager

public org.eclipse.jetty.server.SessionIdManager getMetaManager()
Specified by:
getMetaManager in interface org.eclipse.jetty.server.SessionManager

isFailed

public boolean isFailed()
Specified by:
isFailed in interface org.eclipse.jetty.util.component.LifeCycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.eclipse.jetty.util.component.LifeCycle

isStopped

public boolean isStopped()
Specified by:
isStopped in interface org.eclipse.jetty.util.component.LifeCycle

isStopping

public boolean isStopping()
Specified by:
isStopping in interface org.eclipse.jetty.util.component.LifeCycle

getSessionPath

public String getSessionPath()
Specified by:
getSessionPath in interface org.eclipse.jetty.server.SessionManager

getSessionCookie

public String getSessionCookie()
Specified by:
getSessionCookie in interface org.eclipse.jetty.server.SessionManager

getSessionURL

public String getSessionURL()

access

public org.eclipse.jetty.http.HttpCookie access(javax.servlet.http.HttpSession arg0,
                                                boolean secure)
Specified by:
access in interface org.eclipse.jetty.server.SessionManager

complete

public void complete(javax.servlet.http.HttpSession arg0)
Specified by:
complete in interface org.eclipse.jetty.server.SessionManager

getHttpOnly

public boolean getHttpOnly()
Specified by:
getHttpOnly in interface org.eclipse.jetty.server.SessionManager

getMaxCookieAge

public int getMaxCookieAge()
Specified by:
getMaxCookieAge in interface org.eclipse.jetty.server.SessionManager

getSecureCookies

public boolean getSecureCookies()
Specified by:
getSecureCookies in interface org.eclipse.jetty.server.SessionManager

getSessionDomain

public String getSessionDomain()
Specified by:
getSessionDomain in interface org.eclipse.jetty.server.SessionManager

getSessionURLPrefix

public String getSessionURLPrefix()

isValid

public boolean isValid(javax.servlet.http.HttpSession session)
Specified by:
isValid in interface org.eclipse.jetty.server.SessionManager

setIdManager

public void setIdManager(org.eclipse.jetty.server.SessionIdManager arg0)

setMaxCookieAge

public void setMaxCookieAge(int arg0)
Specified by:
setMaxCookieAge in interface org.eclipse.jetty.server.SessionManager

setSessionCookie

public void setSessionCookie(String arg0)
Specified by:
setSessionCookie in interface org.eclipse.jetty.server.SessionManager

setSessionDomain

public void setSessionDomain(String arg0)
Specified by:
setSessionDomain in interface org.eclipse.jetty.server.SessionManager

setSessionPath

public void setSessionPath(String arg0)
Specified by:
setSessionPath in interface org.eclipse.jetty.server.SessionManager

setSessionURL

public void setSessionURL(String arg0)

getClusterId

public String getClusterId(javax.servlet.http.HttpSession session)
Specified by:
getClusterId in interface org.eclipse.jetty.server.SessionManager
See Also:
org.mortbay.jetty.SessionManager#getClusterId(javax.servlet.http.HttpSession)

getIdManager

public org.eclipse.jetty.server.SessionIdManager getIdManager()
See Also:
org.mortbay.jetty.SessionManager#getIdManager()

getNodeId

public String getNodeId(javax.servlet.http.HttpSession session)
Specified by:
getNodeId in interface org.eclipse.jetty.server.SessionManager
See Also:
org.mortbay.jetty.SessionManager#getNodeId(javax.servlet.http.HttpSession)

isUsingCookies

public boolean isUsingCookies()
Specified by:
isUsingCookies in interface org.eclipse.jetty.server.SessionManager
See Also:
org.mortbay.jetty.SessionManager#isUsingCookies()

getSessionIdPathParameterName

public String getSessionIdPathParameterName()
Specified by:
getSessionIdPathParameterName in interface org.eclipse.jetty.server.SessionManager

getSessionIdPathParameterNamePrefix

public String getSessionIdPathParameterNamePrefix()
Specified by:
getSessionIdPathParameterNamePrefix in interface org.eclipse.jetty.server.SessionManager

setSessionIdPathParameterName

public void setSessionIdPathParameterName(String parameterName)
Specified by:
setSessionIdPathParameterName in interface org.eclipse.jetty.server.SessionManager

addLifeCycleListener

public void addLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener arg0)
Specified by:
addLifeCycleListener in interface org.eclipse.jetty.util.component.LifeCycle

removeLifeCycleListener

public void removeLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener arg0)
Specified by:
removeLifeCycleListener in interface org.eclipse.jetty.util.component.LifeCycle

getSessionIdManager

public org.eclipse.jetty.server.SessionIdManager getSessionIdManager()
Specified by:
getSessionIdManager in interface org.eclipse.jetty.server.SessionManager

setSessionIdManager

public void setSessionIdManager(org.eclipse.jetty.server.SessionIdManager idManager)
Specified by:
setSessionIdManager in interface org.eclipse.jetty.server.SessionManager


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.