ro.isdc.wro.config
Interface ReadOnlyContext
- All Known Implementing Classes:
- Context
public interface ReadOnlyContext
A readonly version of Context
. Prefer to use fields of this type for injection in processors, because it is
thread-safe (the getAggregatedFolderPath is computed correctly in multi-threaded environment).
The interface is required to make it possible to create Proxy
of the Context
during injection using
standard jdk support. It is possible to create also proxies for classes, but a new dependency is required for this
(javassist), which is something I prefer to avoid at this point.
- Author:
- Alex Objelean
getConfig
WroConfiguration getConfig()
- Returns:
WroConfiguration
singleton instance.
getRequest
javax.servlet.http.HttpServletRequest getRequest()
- Returns:
- the request
getResponse
javax.servlet.http.HttpServletResponse getResponse()
- Returns:
- the response
getServletContext
javax.servlet.ServletContext getServletContext()
- Returns:
- the servletContext
getFilterConfig
javax.servlet.FilterConfig getFilterConfig()
- Returns:
- the filterConfig
getAggregatedFolderPath
String getAggregatedFolderPath()
- This field is useful only for the aggregated resources of type
ResourceType.CSS
. The
aggregatedFolderPath is used to compute the depth. For example, if aggregatedFolder is "wro" then the depth is 1
and the path used to prefix the image url is ".."
. If the aggregatedFolder is "css/aggregated", the
depth is 2 and the prefix is "../.."
. The name of the aggregated folder is not important, it is used
only to compute the depth.
- Returns:
- the aggregatedFolderPath
Copyright © 2008-2013. All Rights Reserved.