com.iplanet.jato
Class RequestContextImpl

java.lang.Object
  |
  +--com.iplanet.jato.RequestContextImpl
All Implemented Interfaces:
RequestContext

public class RequestContextImpl
extends java.lang.Object
implements RequestContext

A default implementation if RequestContext

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

Field Summary
static java.lang.String FLAG_RESPONSE_STARTED
           
 
Fields inherited from interface com.iplanet.jato.RequestContext
DISPLAY_PHASE, SUBMIT_PHASE
 
Constructor Summary
RequestContextImpl()
          Default constructor
RequestContextImpl(java.lang.String servletName, javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Create an instance with the specified core objects
 
Method Summary
 void addRequestCompletionListener(RequestCompletionListener listener)
          Adds a request completion listener to the current request.
 java.lang.StringBuffer getMessageBuffer()
          Returns the buffer of accumulated messages.
 java.io.PrintWriter getMessageWriter()
          Returns a PrintWriter that can be used to output application information to the bottom of the rendered HTML resonse.
 ModelManager getModelManager()
          Returns the request's ModelManager
 javax.servlet.http.HttpServletRequest getRequest()
          Returns the request object for the current request
 int getRequestPhase()
          Returns a code for the current phase the request is in.
 javax.servlet.http.HttpServletResponse getResponse()
          Returns the response object for the current request
 javax.servlet.ServletContext getServletContext()
          Returns the request handling servlet's ServletContext
 java.lang.String getServletName()
          Returns the request handling servlet's logical name
 SQLConnectionManager getSQLConnectionManager()
          Returns the request's SQLConnectionManager
 ViewBeanManager getViewBeanManager()
          Returns the request's ViewBeanManager
 boolean hasMessages()
          Returns true if any messages have been written to the message buffer
static void markResponseStarted(RequestContext requestContext)
           
protected  void notifyRequestCompletionListeners()
          Notifies all registered RequestCompletionListeners that the current request is at an end
 void removeRequestCompletionListener(RequestCompletionListener listener)
          Removes a request completion listener from the request context.
 void setModelManager(ModelManager modelManager)
          Set the request context's singleton ModelManager object
 void setSQLConnectionManager(SQLConnectionManager sqlConnectionManager)
          Set the request context's singleton SQLConnectionManager object
 void setViewBeanManager(ViewBeanManager value)
          Set the request context's singleton ViewBeanManager object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG_RESPONSE_STARTED

public static final java.lang.String FLAG_RESPONSE_STARTED
Constructor Detail

RequestContextImpl

public RequestContextImpl()
Default constructor

RequestContextImpl

public RequestContextImpl(java.lang.String servletName,
                          javax.servlet.ServletContext servletContext,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
Create an instance with the specified core objects
Parameters:
servletContext - The current ServletContext
request - The current HttpServletRequest
response - The current HttpServletResponse
Method Detail

getServletName

public java.lang.String getServletName()
Description copied from interface: RequestContext
Returns the request handling servlet's logical name
Specified by:
getServletName in interface RequestContext

getServletContext

public javax.servlet.ServletContext getServletContext()
Description copied from interface: RequestContext
Returns the request handling servlet's ServletContext
Specified by:
getServletContext in interface RequestContext

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface: RequestContext
Returns the request object for the current request
Specified by:
getRequest in interface RequestContext

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Description copied from interface: RequestContext
Returns the response object for the current request
Specified by:
getResponse in interface RequestContext

getViewBeanManager

public ViewBeanManager getViewBeanManager()
Description copied from interface: RequestContext
Returns the request's ViewBeanManager
Specified by:
getViewBeanManager in interface RequestContext

setViewBeanManager

public void setViewBeanManager(ViewBeanManager value)
Set the request context's singleton ViewBeanManager object

getModelManager

public ModelManager getModelManager()
Description copied from interface: RequestContext
Returns the request's ModelManager
Specified by:
getModelManager in interface RequestContext

setModelManager

public void setModelManager(ModelManager modelManager)
Set the request context's singleton ModelManager object

getSQLConnectionManager

public SQLConnectionManager getSQLConnectionManager()
Description copied from interface: RequestContext
Returns the request's SQLConnectionManager
Specified by:
getSQLConnectionManager in interface RequestContext

setSQLConnectionManager

public void setSQLConnectionManager(SQLConnectionManager sqlConnectionManager)
Set the request context's singleton SQLConnectionManager object

getMessageWriter

public java.io.PrintWriter getMessageWriter()
Description copied from interface: RequestContext
Returns a PrintWriter that can be used to output application information to the bottom of the rendered HTML resonse. Anything printed through this object will be buffered and then appended in a block following the flushing of the response. This mechanism is intended as a development time aid, a means of attaching application information to the relevant page.
Specified by:
getMessageWriter in interface RequestContext

hasMessages

public boolean hasMessages()
Description copied from interface: RequestContext
Returns true if any messages have been written to the message buffer
Specified by:
hasMessages in interface RequestContext

getMessageBuffer

public java.lang.StringBuffer getMessageBuffer()
Description copied from interface: RequestContext
Returns the buffer of accumulated messages. Applications should write messages to this buffer using the getMessageWriter() method.
Specified by:
getMessageBuffer in interface RequestContext

addRequestCompletionListener

public void addRequestCompletionListener(RequestCompletionListener listener)
Description copied from interface: RequestContext
Adds a request completion listener to the current request. All registered listeners will be notified when the request is complete, in no particular order. Listener registrations are per request; they do not persist between requests.
Specified by:
addRequestCompletionListener in interface RequestContext
Following copied from interface: com.iplanet.jato.RequestContext
Parameters:
listener - The object wishing to be notified of the end of the request

removeRequestCompletionListener

public void removeRequestCompletionListener(RequestCompletionListener listener)
Description copied from interface: RequestContext
Removes a request completion listener from the request context. The removed listener will not be notified of the end of the request. Listener registrations are per request; they do not persist between requests.
Specified by:
removeRequestCompletionListener in interface RequestContext
Following copied from interface: com.iplanet.jato.RequestContext
Parameters:
listener - The object wishing to be removed from the notification list

notifyRequestCompletionListeners

protected void notifyRequestCompletionListeners()
Notifies all registered RequestCompletionListeners that the current request is at an end

getRequestPhase

public int getRequestPhase()
Returns a code for the current phase the request is in.
Specified by:
getRequestPhase in interface RequestContext

markResponseStarted

public static void markResponseStarted(RequestContext requestContext)