|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.isdc.wro.config.Context
public class Context
Holds the properties related to a request cycle.
Method Summary | |
---|---|
static void |
destroy()
Perform context clean-up. |
static Context |
get()
|
String |
getAggregatedFolderPath()
This field is useful only for the aggregated resources of type ResourceType.CSS . |
WroConfiguration |
getConfig()
|
static String |
getCorrelationId()
|
javax.servlet.FilterConfig |
getFilterConfig()
|
javax.servlet.http.HttpServletRequest |
getRequest()
|
javax.servlet.http.HttpServletResponse |
getResponse()
|
javax.servlet.ServletContext |
getServletContext()
|
static boolean |
isContextSet()
|
static void |
set(Context context)
Set a context with default configuration to current thread. |
static void |
set(Context context,
WroConfiguration config)
Associate a context with the CURRENT request cycle. |
void |
setAggregatedFolderPath(String aggregatedFolderPath)
|
void |
setConfig(WroConfiguration config)
DO NOT CALL THIS METHOD UNLESS YOU ARE SURE WHAT YOU ARE DOING. |
static void |
setCorrelationId(String correlationId)
Set the correlationId to the current thread. |
static Context |
standaloneContext()
A context useful for running in non web context (standalone applications). |
String |
toString()
|
static void |
unset()
Remove context from the local thread. |
static void |
unsetCorrelationId()
Remove the correlationId from the current thread. |
static Context |
webContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterConfig filterConfig)
A context useful for running in web context (inside a servlet container). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public WroConfiguration getConfig()
getConfig
in interface ReadOnlyContext
WroConfiguration
singleton instance.public void setConfig(WroConfiguration config)
WroConfiguration
singleton instance.
public static Context webContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterConfig filterConfig)
public static Context standaloneContext()
public static Context get()
Context
associated with CURRENT request cycle.public static boolean isContextSet()
public static void set(Context context)
public static void set(Context context, WroConfiguration config)
context
- Context
to set.public static void unset()
public javax.servlet.http.HttpServletRequest getRequest()
getRequest
in interface ReadOnlyContext
public javax.servlet.http.HttpServletResponse getResponse()
getResponse
in interface ReadOnlyContext
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface ReadOnlyContext
public javax.servlet.FilterConfig getFilterConfig()
getFilterConfig
in interface ReadOnlyContext
public String getAggregatedFolderPath()
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.
getAggregatedFolderPath
in interface ReadOnlyContext
public void setAggregatedFolderPath(String aggregatedFolderPath)
aggregatedFolderPath
- the aggregatedFolderPath to setpublic static void destroy()
public static void setCorrelationId(String correlationId)
public static void unsetCorrelationId()
Context
associated
with the correlationId. In order to remove context, call unset()
.
Unsetting correlationId is useful when you create child threads which needs to access the correlationId from the
parent thread. This simulates the InheritableThreadLocal
functionality.
public static String getCorrelationId()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |