com.iplanet.jato
Class RequestManager

java.lang.Object
  |
  +--com.iplanet.jato.RequestManager

public class RequestManager
extends java.lang.Object

A mechanism that provides threadsafe static access to the current request context. Note that although we provide this mechanism, we do not in general recommend its use. There are several reasons for taking this position.

First, making the request context available statically requires thread synchronization, thus introducing a potential performance issue if the request context is obtained frequently and/or by many threads. Note that once the caller has obtained the request context, there is no need for further thread synchronization. Therefore, we recommend that if this mechanism is used, callers cache the reference to the obtained request context for the life of the request.

Second, most objects already have non-static (and thus non-synchronized) access to the request context. Managed objects like view beans and models which implement the RequestParticipant interface have the request context already set to them. The request context is thus available directly to model implementations as well as sub-views via the View.getParentViewBean().getRequestContext() method.

Version:
JATO/1.2.2 $Id: RequestManager.java,v 1.9 2002/03/16 03:26:28 todd Exp $

Method Summary
static javax.servlet.http.HttpServletRequest getRequest()
          Return the request object contained in the current thread's request context
static RequestContext getRequestContext()
          Return the request context associate with the current thread
static javax.servlet.http.HttpServletResponse getResponse()
          Return the response object contained in the current thread's request context
static javax.servlet.http.HttpSession getSession()
          Return the HttpSession contained in the current thread's request context
protected static void setRequestContext(RequestContext context)
          Registers the specified request context with the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRequestContext

public static RequestContext getRequestContext()
Return the request context associate with the current thread

setRequestContext

protected static void setRequestContext(RequestContext context)
Registers the specified request context with the current thread. This method is normally called by ApplicationServletBase during initialization of a request.

getRequest

public static javax.servlet.http.HttpServletRequest getRequest()
Return the request object contained in the current thread's request context

getResponse

public static javax.servlet.http.HttpServletResponse getResponse()
Return the response object contained in the current thread's request context

getSession

public static javax.servlet.http.HttpSession getSession()
Return the HttpSession contained in the current thread's request context