public class MockValveContext extends Object implements ValveContext
Constructor and Description |
---|
MockValveContext(HstRequest request,
HstResponse response) |
Modifier and Type | Method and Description |
---|---|
PageCacheContext |
getPageCacheContext()
Returns the
PageCacheContext for this valve context. |
HstContainerConfig |
getRequestContainerConfig()
Returns the HstComponent container configuration.
|
HstRequestContext |
getRequestContext()
Returns the current request context.
|
HstComponentWindow |
getRootComponentRenderingWindow()
Returns the root
HstComponentWindow instance to *render* the current request. |
HstComponentWindow |
getRootComponentWindow()
Returns the root
HstComponentWindow instance that is used to process the current request. |
javax.servlet.http.HttpServletRequest |
getServletRequest()
Returns the current servlet request.
|
javax.servlet.http.HttpServletResponse |
getServletResponse()
Returns the current servlet response.
|
void |
invokeNext()
Requests invocation of next possible valve.
|
boolean |
isNextValveInvoked() |
void |
setHttpServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
|
void |
setRootComponentRenderingWindow(HstComponentWindow rootComponentRenderingWindow)
Sets the root
HstComponentWindow instance to *render* the current request |
void |
setRootComponentWindow(HstComponentWindow rootComponentWindow)
Sets the root
HstComponentWindow instancethat is used to process the current request. |
public MockValveContext(HstRequest request, HstResponse response)
public void invokeNext() throws ContainerException
ValveContext
invokeNext
in interface ValveContext
ContainerException
public boolean isNextValveInvoked()
public HstContainerConfig getRequestContainerConfig()
ValveContext
getRequestContainerConfig
in interface ValveContext
public HstRequestContext getRequestContext()
ValveContext
getRequestContext
in interface ValveContext
public javax.servlet.http.HttpServletRequest getServletRequest()
ValveContext
getServletRequest
in interface ValveContext
public javax.servlet.http.HttpServletResponse getServletResponse()
ValveContext
getServletResponse
in interface ValveContext
public void setHttpServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
ValveContext
HttpServletResponse
for this ValveContext
to servletResponse
. This is
typically useful when for example you want to wrap the response by some HttpServletResponseWrapper
and
use this wrapper response for further processingsetHttpServletResponse
in interface ValveContext
public void setRootComponentWindow(HstComponentWindow rootComponentWindow)
ValveContext
HstComponentWindow
instancethat is used to process the current request.setRootComponentWindow
in interface ValveContext
public HstComponentWindow getRootComponentWindow()
ValveContext
HstComponentWindow
instance that is used to process the current request. Note that
in case of a action/resource/component-rendering request the root component is in general the
targeted (for the action/resource/component-rendering) componentgetRootComponentWindow
in interface ValveContext
HstComponentWindow
instance that is used to process the current request.public void setRootComponentRenderingWindow(HstComponentWindow rootComponentRenderingWindow)
ValveContext
HstComponentWindow
instance to *render* the current requestsetRootComponentRenderingWindow
in interface ValveContext
public HstComponentWindow getRootComponentRenderingWindow()
ValveContext
Returns the root HstComponentWindow
instance to *render* the current request. By default, this
returns the same HstComponentWindow
as ValveContext.getRootComponentWindow()
, unless it is explicitly
set to a different HstComponentWindow
. For example in case when you want to render only a single (or subtree)
HstComponent
of an entire HstComponent
hierarchy.
The rootComponentRenderingWindow must always be a descendant of or the same as ValveContext.getRootComponentWindow()
getRootComponentRenderingWindow
in interface ValveContext
public PageCacheContext getPageCacheContext()
ValveContext
PageCacheContext
for this valve context. Individual Valve
s can access this PageCacheContext
and append key information to the PageCacheContext.getPageCacheKey()
or indicate
that the request cannot be cached at all through PageCacheContext.markUncacheable()
getPageCacheContext
in interface ValveContext
null
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.