org.barracudamvc.plankton.http
Class ContextServices
java.lang.Object
org.barracudamvc.plankton.http.ContextServices
- Direct Known Subclasses:
- ContextServices
public class ContextServices
- extends Object
This class defines a convenience method to get the servlet
context. 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 String |
KEY
|
protected static org.apache.log4j.Logger |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY
public static final String KEY
logger
protected static final org.apache.log4j.Logger logger
ContextServices
public ContextServices()
getObjectFromCache
public static Object getObjectFromCache(javax.servlet.ServletContext context,
Object key,
ReferenceFactory factory)
- This method looks for an object in the servlet context based on a given key.
If the object is not present, it will be created using the ReferenceFactory
and cached in session for future use.
- Parameters:
context
- the ServletContextkey
- the key that identifies this objectfactory
- the ReferenceFactory used to create the object
- Returns:
- the object from the cache
Copyright © 2006 BarracudaMVC.org All Rights Reserved.