org.apache.struts2.interceptor
public class: ProfilingActivationInterceptor [javadoc |
source]
java.lang.Object
com.opensymphony.xwork2.interceptor.AbstractInterceptor
org.apache.struts2.interceptor.ProfilingActivationInterceptor
Allows profiling to be enabled or disabled via request parameters, when
devMode is enabled.
none
// to change the profiling key
...
profilingKey
...
- version:
$ - Date: 2006-11-23 18:31:52 +0100 (Do, 23 Nov 2006) $ $Id: ProfilingActivationInterceptor.java 478625 2006-11-23 17:31:52Z wsmoak $
| Method from org.apache.struts2.interceptor.ProfilingActivationInterceptor Detail: |
public String getProfilingKey() {
return profilingKey;
}
|
public String intercept(ActionInvocation invocation) throws Exception {
if (devMode) {
Object val = invocation.getInvocationContext().getParameters().get(profilingKey);
if (val != null) {
String sval = (val instanceof String ? (String)val : ((String[])val)[0]);
boolean enable = "yes".equalsIgnoreCase(sval) || "true".equalsIgnoreCase(sval);
UtilTimerStack.setActive(enable);
invocation.getInvocationContext().getParameters().remove(profilingKey);
}
}
return invocation.invoke();
}
|
public void setDevMode(String mode) {
this.devMode = "true".equals(mode);
}
|
public void setProfilingKey(String profilingKey) {
this.profilingKey = profilingKey;
}
|