| 1 |
|
package com.atlassian.xwork.interceptors; |
| 2 |
|
|
| 3 |
|
import com.opensymphony.xwork.interceptor.AroundInterceptor; |
| 4 |
|
import com.opensymphony.xwork.ActionInvocation; |
| 5 |
|
import com.opensymphony.xwork.ActionProxy; |
| 6 |
|
import com.opensymphony.webwork.ServletActionContext; |
| 7 |
|
import com.atlassian.util.profiling.UtilTimerStack; |
| 8 |
|
import com.atlassian.util.profiling.ProfilingUtils; |
| 9 |
|
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 6 |
Complexity Density: 0.6 |
|
| 10 |
|
public class XWorkProfilingInterceptor extends AroundInterceptor |
| 11 |
|
{ |
| 12 |
|
String location; |
| 13 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 14 |
0
|
protected void before(ActionInvocation actionInvocation) throws Exception... |
| 15 |
|
{ |
| 16 |
0
|
UtilTimerStack.push(makeStackKey(actionInvocation.getProxy())); |
| 17 |
0
|
ServletActionContext.getRequest(); |
| 18 |
|
} |
| 19 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 20 |
0
|
protected void after(ActionInvocation actionInvocation, String string) throws Exception... |
| 21 |
|
{ |
| 22 |
0
|
UtilTimerStack.pop(makeStackKey(actionInvocation.getProxy())); |
| 23 |
|
} |
| 24 |
|
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 25 |
0
|
private String makeStackKey(ActionProxy proxy)... |
| 26 |
|
{ |
| 27 |
0
|
String methodName = proxy.getConfig().getMethodName(); |
| 28 |
|
|
| 29 |
0
|
if (methodName == null) |
| 30 |
0
|
methodName = "execute"; |
| 31 |
|
|
| 32 |
0
|
String actionClazz = ProfilingUtils.getJustClassName(proxy.getConfig().getClassName()); |
| 33 |
|
|
| 34 |
0
|
return "XW Interceptor: " + (location != null ? location + ": " : "") + proxy.getNamespace() + "/" + proxy.getActionName() + ".action (" + actionClazz + "." + methodName + "())"; |
| 35 |
|
} |
| 36 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 37 |
0
|
public String getLocation()... |
| 38 |
|
{ |
| 39 |
0
|
return location; |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 42 |
0
|
public void setLocation(String location)... |
| 43 |
|
{ |
| 44 |
0
|
this.location = location; |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
} |