|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.cinnamon.service.RequestContext
public abstract class RequestContext
Abstract base class for request context implementations. In most scenarios Cinnamon will likely be used
inside a web application and thus use HttpRequestContext as concrete implementation.
But Cinnamon can also be used outside a Servlet container, i.e. for Unit/Integration Tests. For those
cases custom subclasses of RequestContext can be created.
RequestContext instances will be associated with the thread of the request and can be retrieved with
the static getCurrentContext method.
| Constructor Summary | |
|---|---|
protected |
RequestContext(CinnamonConfig config)
Creates a new RequestContext. |
| Method Summary | |
|---|---|
protected abstract Map<String,Object> |
createApplicationMap()
Creates the application attribute Map for this request. |
protected abstract Map<String,String> |
createInitMap()
Creates the initialization parameter Map for this request. |
protected abstract Map<String,String> |
createParameterMap()
Creates the request parameter Map for this request. |
protected abstract Map<String,String[]> |
createParameterValuesMap()
Creates the request parameter Map for this request. |
protected abstract Map<String,Object> |
createRequestMap()
Creates the request attribute Map for this request. |
protected abstract Map<String,Object> |
createSessionMap()
Creates the session attribute Map for this request. |
Map<String,Object> |
getApplicationMap()
Returns the Map containing all application attributes. |
CinnamonConfig |
getCinnamonConfig()
Return the CinnamonConfig instance associated with this request. |
static RequestContext |
getCurrentContext()
Returns the RequestContext for the current thread. |
Map<String,String> |
getInitMap()
Returns the Map containing all initialization parameters. |
Map<String,String> |
getParameterMap()
Returns the Map containing all request parameters. |
Map<String,String[]> |
getParameterValuesMap()
Returns the Map containing all request parameters. |
abstract Object |
getRequest()
Returns an environment-specific instance representing the current request. |
Map<String,Object> |
getRequestMap()
Returns the Map containing all request attributes. |
abstract Object |
getResponse()
Returns an environment-specific instance representing the current response. |
Map<String,Object> |
getSessionMap()
Returns the Map containing all session attributes. |
static void |
setCurrentContext(RequestContext newContext)
Sets the RequestContext for the current thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected RequestContext(CinnamonConfig config)
config - the CinnamonConfig instance in effect for this request| Method Detail |
|---|
public static RequestContext getCurrentContext()
public static void setCurrentContext(RequestContext newContext)
CinnamonServlet will
create the RequestContext instance for each request.
newContext - the RequestContext that should be associated with the current threadpublic CinnamonConfig getCinnamonConfig()
public Map<String,Object> getRequestMap()
public Map<String,Object> getSessionMap()
public Map<String,Object> getApplicationMap()
public Map<String,String> getInitMap()
public Map<String,String> getParameterMap()
public Map<String,String[]> getParameterValuesMap()
public abstract Object getRequest()
public abstract Object getResponse()
protected abstract Map<String,Object> createRequestMap()
protected abstract Map<String,Object> createSessionMap()
protected abstract Map<String,Object> createApplicationMap()
protected abstract Map<String,String> createInitMap()
protected abstract Map<String,String> createParameterMap()
protected abstract Map<String,String[]> createParameterValuesMap()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||