de.is24.util.monitoring.spring
Class MonitoringHandlerInterceptor

java.lang.Object
  extended by de.is24.util.monitoring.spring.MonitoringHandlerInterceptor
All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor

public class MonitoringHandlerInterceptor
extends Object
implements org.springframework.web.servlet.HandlerInterceptor

HandlerInterceptor to monitor duration of request processing


Field Summary
private static Pattern CGLIB_PATTERN
           
private static String COMPLETE
           
private static String ERROR
           
private static String HANDLING
           
private static org.apache.log4j.Logger LOG
           
private  InApplicationMonitor monitor
           
(package private) static String POST_HANDLE_TIME
           
private static String PREFIX
           
private static String RENDERING
           
(package private) static String START_TIME
           
 
Constructor Summary
MonitoringHandlerInterceptor()
           
 
Method Summary
 void afterCompletion(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, Exception ex)
          check, whether POST_HANDLE_TIME is set, and add timer measuremets for post phase and complete request.
private  Object getAndRemoveAttribute(javax.servlet.http.HttpServletRequest request, String attributeName)
           
protected  String getPrefix(Object handler)
           
 void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
           
 boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

PREFIX

private static final String PREFIX
See Also:
Constant Field Values

START_TIME

static final String START_TIME
See Also:
Constant Field Values

POST_HANDLE_TIME

static final String POST_HANDLE_TIME
See Also:
Constant Field Values

HANDLING

private static final String HANDLING
See Also:
Constant Field Values

RENDERING

private static final String RENDERING
See Also:
Constant Field Values

COMPLETE

private static final String COMPLETE
See Also:
Constant Field Values

ERROR

private static final String ERROR
See Also:
Constant Field Values

monitor

private InApplicationMonitor monitor

CGLIB_PATTERN

private static final Pattern CGLIB_PATTERN
Constructor Detail

MonitoringHandlerInterceptor

public MonitoringHandlerInterceptor()
Method Detail

preHandle

public boolean preHandle(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response,
                         Object handler)
                  throws Exception
Specified by:
preHandle in interface org.springframework.web.servlet.HandlerInterceptor
Throws:
Exception

postHandle

public void postHandle(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       Object handler,
                       org.springframework.web.servlet.ModelAndView modelAndView)
                throws Exception
Specified by:
postHandle in interface org.springframework.web.servlet.HandlerInterceptor
Throws:
Exception

afterCompletion

public void afterCompletion(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            Object handler,
                            Exception ex)
                     throws Exception
check, whether POST_HANDLE_TIME is set, and add timer measuremets for post phase and complete request.

Specified by:
afterCompletion in interface org.springframework.web.servlet.HandlerInterceptor
Throws:
Exception

getAndRemoveAttribute

private Object getAndRemoveAttribute(javax.servlet.http.HttpServletRequest request,
                                     String attributeName)

getPrefix

protected String getPrefix(Object handler)


Copyright © 2013 Immobilien Scout GmbH. All Rights Reserved.