|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.spring.webmvc.MonitoringHandlerInterceptor
public class MonitoringHandlerInterceptor
Spring MVC interceptor monitors time spent in handlers (usually controllers) and views. Spring configuration:
<mvc:interceptors>
<bean class="org.javasimon.spring.webmvc.MonitoringHandlerInterceptor"/>
</mvc:interceptors>
| Field Summary | |
|---|---|
private StopwatchSource<HandlerLocation> |
stopwatchSource
Stopwatch source. |
private ThreadLocal<HandlerLocation> |
threadLocation
Current thread running split, if any. |
| Constructor Summary | |
|---|---|
MonitoringHandlerInterceptor()
Default constructor: default stopwatch source, default manager. |
|
MonitoringHandlerInterceptor(Manager manager)
Constructor with simon manager and default stopwatch source. |
|
MonitoringHandlerInterceptor(StopwatchSource<HandlerLocation> stopwatchSource)
Constructor with stopwatch source. |
|
| Method Summary | |
|---|---|
void |
afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception ex)
Invoked after view. |
void |
postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
org.springframework.web.servlet.ModelAndView modelAndView)
Invoked between controller and view. |
boolean |
preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler)
Invoked before controller. |
protected Split |
startStopwatch(HandlerLocation location)
Start stopwatch for given name and thread. |
protected Split |
stopStopwatch()
Stop current thread stopwatch (if any). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final ThreadLocal<HandlerLocation> threadLocation
private StopwatchSource<HandlerLocation> stopwatchSource
| Constructor Detail |
|---|
public MonitoringHandlerInterceptor(StopwatchSource<HandlerLocation> stopwatchSource)
stopwatchSource - Stopwatch sourcepublic MonitoringHandlerInterceptor(Manager manager)
manager - Manager managerpublic MonitoringHandlerInterceptor()
| Method Detail |
|---|
protected final Split startStopwatch(HandlerLocation location)
protected final Split stopStopwatch()
public boolean preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler)
preHandle in interface org.springframework.web.servlet.HandlerInterceptor
public void postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
org.springframework.web.servlet.ModelAndView modelAndView)
postHandle in interface org.springframework.web.servlet.HandlerInterceptor
public void afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception ex)
afterCompletion in interface org.springframework.web.servlet.HandlerInterceptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||