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
<action ...>
...
<interceptor-ref name="profiling">
<param name="profilingKey">profilingKey</param>
</interceptor-ref>
...
</action>
- version:
$ - Date: 2008-04-27 09:41:38 -0400 (Sun, 27 Apr 2008) $ $Id: ProfilingActivationInterceptor.java 651946 2008-04-27 13:41:38Z apetrelli $
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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;
}
|