|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.barracuda.core.util.http.SessionServices
This class defines a convenience method to get the session and set the timeout at the same time. It also provides a mechanism to easily cache objects in the session by Reference (which allows them to automatically be removed from the session if the system starts running low on memory)
Field Summary | |
static java.lang.String |
KEY
|
protected static org.apache.log4j.Logger |
logger
|
Constructor Summary | |
SessionServices()
|
Method Summary | |
static java.lang.Object |
getObjectFromCache(ControlEventContext context,
java.lang.Object key,
ReferenceFactory factory)
This method retrieves the session from the Context, and then looks for an object in the session based on a given key. |
static java.lang.Object |
getObjectFromCache(javax.servlet.http.HttpSession session,
java.lang.Object key,
ReferenceFactory factory)
This method looks for an object in the session based on a given key. |
static javax.servlet.http.HttpSession |
getSession(javax.servlet.http.HttpServletRequest req)
get the session from a request. |
static javax.servlet.http.HttpSession |
getSession(javax.servlet.http.HttpServletRequest req,
boolean create)
get the session from a request (allowing you to specify whether or not to create it) |
static javax.servlet.http.HttpSession |
getSession(javax.servlet.http.HttpServletRequest req,
boolean create,
java.lang.Integer timeout)
get the session from a request (allowing you to specify whether or not to create it). |
static javax.servlet.http.HttpSession |
getSession(ViewContext vc)
get the session from the view context (it will automatically extract the event context and cast it to ControlEventContext for you, then retrieve the request from there and use that to get the session info). |
static javax.servlet.http.HttpSession |
getSession(ViewContext vc,
boolean create)
get the session from the view context (allowing you to specify whether or not to create it) |
static javax.servlet.http.HttpSession |
getSession(ViewContext vc,
boolean create,
java.lang.Integer timeout)
get the session from the view context (allowing you to specify whether or not to create it). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String KEY
protected static org.apache.log4j.Logger logger
Constructor Detail |
public SessionServices()
Method Detail |
public static javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest req)
req
- the ServletRequest object
public static javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest req, boolean create)
req
- the ServletRequest object
public static javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest req, boolean create, java.lang.Integer timeout)
req
- the ServletRequest objectcreate
- if true, the session will be created if it does not
already existtimeout
- the default timeout value (null indicates do not set)
public static javax.servlet.http.HttpSession getSession(ViewContext vc)
vc
- the ViewContext
public static javax.servlet.http.HttpSession getSession(ViewContext vc, boolean create)
vc
- the ViewContext
public static javax.servlet.http.HttpSession getSession(ViewContext vc, boolean create, java.lang.Integer timeout)
vc
- the ViewContextcreate
- if true, the session will be created if it does not
already existtimeout
- the default timeout value (null indicates do not set)
public static java.lang.Object getObjectFromCache(ControlEventContext context, java.lang.Object key, ReferenceFactory factory)
context
- the ControlEventContextkey
- the key that identifies this objectfactory
- the ReferenceFactory used to create the object
public static java.lang.Object getObjectFromCache(javax.servlet.http.HttpSession session, java.lang.Object key, ReferenceFactory factory)
session
- the HttpSessionkey
- the key that identifies this objectfactory
- the ReferenceFactory used to create the object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |