Package net.bull.javamelody
Class MonitoringFilter
java.lang.Object
net.bull.javamelody.MonitoringFilter
- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
PluginMonitoringFilter
Filtre de servlet pour le monitoring.
C'est la classe de ce filtre qui doit être déclarée dans le fichier web.xml de la webapp.
- Author:
- Emeric Vernat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpServletRequestcreateRequestWrapper(HttpServletRequest request, HttpServletResponse response) protected CounterServletResponseWrappercreateResponseWrapper(HttpServletRequest httpRequest, HttpServletResponse httpResponse) voiddestroy()voiddoFilter(ServletRequest request, ServletResponse response, FilterChain chain) protected StringgetMonitoringUrl(HttpServletRequest httpRequest) protected StringgetRequestName(HttpServletRequest request) voidinit(FilterConfig config) protected booleanisAllowed(HttpServletRequest httpRequest, HttpServletResponse httpResponse) protected final booleanisRumMonitoring(HttpServletRequest httpRequest, HttpServletResponse httpResponse) protected voidlog(HttpServletRequest httpRequest, String requestName, long duration, boolean systemError, int responseStatus, long responseSize) static voidregisterApplicationNodeInCollectServer(String applicationName, URL collectServerUrl, URL applicationNodeUrl) Asynchronously calls the optional collect server to register this application's node to be monitored.voidsetApplicationType(String applicationType) static voidCall the optional collect server to unregister this application's node.
-
Constructor Details
-
MonitoringFilter
public MonitoringFilter()Constructeur.
-
-
Method Details
-
getApplicationType
- Returns:
- Type of application
-
setApplicationType
- Parameters:
applicationType- Type of application
-
init
- Specified by:
initin interfaceFilter- Throws:
ServletException
-
destroy
public void destroy() -
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException - Specified by:
doFilterin interfaceFilter- Throws:
IOExceptionServletException
-
createResponseWrapper
protected CounterServletResponseWrapper createResponseWrapper(HttpServletRequest httpRequest, HttpServletResponse httpResponse) -
createRequestWrapper
protected HttpServletRequest createRequestWrapper(HttpServletRequest request, HttpServletResponse response) throws IOException - Throws:
IOException
-
getRequestName
-
getMonitoringUrl
-
isRumMonitoring
protected final boolean isRumMonitoring(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException - Throws:
IOException
-
isAllowed
protected boolean isAllowed(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException - Throws:
IOException
-
log
protected void log(HttpServletRequest httpRequest, String requestName, long duration, boolean systemError, int responseStatus, long responseSize) -
registerApplicationNodeInCollectServer
public static void registerApplicationNodeInCollectServer(String applicationName, URL collectServerUrl, URL applicationNodeUrl) Asynchronously calls the optional collect server to register this application's node to be monitored.- Parameters:
applicationName- Name of the application in the collect server:
if it already exists the node will be added with the other nodes, if null name will be "contextPath_hostname".collectServerUrl- Url of the collect server, for example http://11.22.33.44:8080applicationNodeUrl- Url of this application node to be called by the collect server, for example http://55.66.77.88:8080/mywebapp
-
unregisterApplicationNodeInCollectServer
Call the optional collect server to unregister this application's node.- Throws:
IOException- e
-