org.apache.beehive.netui.pageflow
Class PageFlowContext

Object
  extended by PageFlowContext

public class PageFlowContext
extends Object

This class is a ThreadLocal class that contains the servlet information. In addition, it supports a Map that allows other aspects of the framework to create place their own context objects into the thread local context.


Constructor Summary
PageFlowContext()
           
 
Method Summary
 Object get(String name, PageFlowContextActivator activator)
          This method will lookup a named object and return it.
static PageFlowContext getContext()
          Factory method that will return the PageFlowContext object to the caller.
 HttpServletRequest getRequest()
          Return the request object.
 HttpServletResponse getResponse()
          Return the response object to the caller.
 ServletContext getServletContext()
          Return the servlet context.
 void init()
          Place the context into it's initialized state.
 void setRequest(HttpServletRequest request)
          Set the request object.
 void setResponse(HttpServletResponse response)
          Set the response object on the context.
 void setServletContext(ServletContext servletContext)
          Set the servlet context for this request.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageFlowContext

public PageFlowContext()
Method Detail

getContext

public static PageFlowContext getContext()
Factory method that will return the PageFlowContext object to the caller.

Returns:
A PageFlowContext that is associated with the tread.

getRequest

public HttpServletRequest getRequest()
Return the request object.

Returns:
The HttpServletRequest object.

setRequest

public void setRequest(HttpServletRequest request)
Set the request object.

Parameters:
request - The HttpServletRequst

getResponse

public HttpServletResponse getResponse()
Return the response object to the caller.

Returns:
The HttpServletResponse object.

setResponse

public void setResponse(HttpServletResponse response)
Set the response object on the context.

Parameters:
response - The HttpServletResponse object.

getServletContext

public ServletContext getServletContext()
Return the servlet context.

Returns:
The ServletContext object for this request.

setServletContext

public void setServletContext(ServletContext servletContext)
Set the servlet context for this request.

Parameters:
servletContext - The ServletContext object.

get

public Object get(String name,
                  PageFlowContextActivator activator)
This method will lookup a named object and return it. The object is looked up by name. If the object doesn't exist, the activator object is called to create a new instance of the object before it is returned.

Parameters:
name - The name of the object to return
activator - An PageFlowContextActivator that will create the new object if it doesn't exist.
Returns:
The object stored by the name.

init

public void init()
Place the context into it's initialized state.