org.openamf
Class RequestContext

java.lang.Object
  extended byorg.openamf.RequestContext

public class RequestContext
extends java.lang.Object

This class allows web applications to easily access the HttpServletRequest and HttpServletResponse objects. OpenAMF's RequestContext class was inspired by the example code in chapter 7 of "Flash Remoting: The Definitive Guide" by Tom Muck. This class uses thread local storage. To learn more about thread local storage, read this article: http://www-106.ibm.com/developerworks/java/library/j-threads3.html

Author:
Sean C. Sullivan

Method Summary
static void clear()
          clears the request context data
static javax.servlet.http.HttpServletRequest getHttpServletRequest()
           
static javax.servlet.http.HttpServletResponse getHttpServletResponse()
           
static javax.servlet.http.HttpSession getHttpSession()
           
static javax.servlet.http.HttpSession getHttpSession(boolean create)
           
static AMFMessage getRequestMessage()
           
static void setHttpServletRequest(javax.servlet.http.HttpServletRequest req)
           
static void setHttpServletResponse(javax.servlet.http.HttpServletResponse resp)
           
static void setRequestMessage(AMFMessage m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setHttpServletRequest

public static void setHttpServletRequest(javax.servlet.http.HttpServletRequest req)
Parameters:
req - the servlet request object
See Also:
getHttpServletRequest()

setHttpServletResponse

public static void setHttpServletResponse(javax.servlet.http.HttpServletResponse resp)
Parameters:
resp - the servlet response object
See Also:
getHttpServletResponse()

clear

public static void clear()
clears the request context data


getHttpServletRequest

public static javax.servlet.http.HttpServletRequest getHttpServletRequest()
Returns:
may return null
See Also:
setHttpServletRequest(HttpServletRequest)

getHttpServletResponse

public static javax.servlet.http.HttpServletResponse getHttpServletResponse()
Returns:
may return null
See Also:
setHttpServletResponse(HttpServletResponse)

getHttpSession

public static javax.servlet.http.HttpSession getHttpSession()
Returns:
a non-null value
See Also:
getHttpSession(boolean), getHttpServletRequest()

getHttpSession

public static javax.servlet.http.HttpSession getHttpSession(boolean create)
Parameters:
create -
Returns:
may return null
See Also:
getHttpSession(), getHttpServletRequest()

getRequestMessage

public static AMFMessage getRequestMessage()
Returns:
may return null

setRequestMessage

public static void setRequestMessage(AMFMessage m)