com.jamonapi.http
Class JAMonServletFilter
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.jamonapi.http.JAMonServletFilter
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig
public class JAMonServletFilter
- extends javax.servlet.http.HttpServlet
- implements javax.servlet.Filter
Note this servlet filter is more functional than com.jamonapi.JAMonFilter, but either can be used.
This is a wrapper class for the true monitoring class of HttpMonFactory.
jamon
JAMonServletFilter
com.jamonapi.http.JAMonServletFilter
JAMonServletFilter
*
- See Also:
- Serialized Form
Method Summary |
void |
addSummaryLabel(java.lang.String jamonSummaryLabel)
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
Servlet filter method that does the monitoring |
boolean |
getEnabled()
|
boolean |
getIgnoreHttpParams()
Containers (tomcat/jetty etc) put jessionid (and other params) as part of what is returned by HttpServletRequest.getRequestURI, and HttpServletRequest.getRequestURL. |
int |
getSize()
|
java.lang.String |
getSummaryLabels()
|
void |
init(javax.servlet.FilterConfig arg0)
|
void |
setEnabled(boolean enable)
enable/disable monitoring. |
void |
setIgnoreHttpParams(boolean ignoreHttpParams)
Containers (tomcat/jetty etc) put jessionid (and other params) as part of what is returned by HttpServletRequest.getRequestURI, and HttpServletRequest.getRequestURL. |
void |
setSize(int size)
Set maximum number of rows that can be in jamon before no more records are added. |
void |
setSummaryLabels(java.lang.String jamonSummaryLabels)
|
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.Filter |
destroy |
JAMonServletFilter
public JAMonServletFilter()
doFilter
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
- Servlet filter method that does the monitoring
- Specified by:
doFilter
in interface javax.servlet.Filter
- Throws:
java.io.IOException
javax.servlet.ServletException
setSummaryLabels
public void setSummaryLabels(java.lang.String jamonSummaryLabels)
getSummaryLabels
public java.lang.String getSummaryLabels()
addSummaryLabel
public void addSummaryLabel(java.lang.String jamonSummaryLabel)
getIgnoreHttpParams
public boolean getIgnoreHttpParams()
- Containers (tomcat/jetty etc) put jessionid (and other params) as part of what is returned by HttpServletRequest.getRequestURI, and HttpServletRequest.getRequestURL.
This can make many pages not unique enough to benefit from jamon, so by default this part of the url is removed from the monitoring label.
Example this: /myapp/mypage.jsp;jsessionid=320sljsdofou
becomes this in the jamon label: /myapp/mypage.jsp
getIgnoreHttpParams() - return if this is enabled or disabled (true means the params will be removed/ignored. This is the default behaviour)
setIgnoreHttpParams(boolean httpIgnoreParams) - set whether it is enabled or disabled (true means the params will be removed/ignored. This is the default behaviour)
setIgnoreHttpParams
public void setIgnoreHttpParams(boolean ignoreHttpParams)
- Containers (tomcat/jetty etc) put jessionid (and other params) as part of what is returned by HttpServletRequest.getRequestURI, and HttpServletRequest.getRequestURL.
This can make many pages not unique enough to benefit from jamon, so by default this part of the url is removed from the monitoring label.
Example this: /myapp/mypage.jsp;jsessionid=320sljsdofou
becomes this in the jamon label: /myapp/mypage.jsp
getIgnoreHttpParams() - return if this is enabled or disabled (true means the params will be removed/ignored. This is the default behaviour)
setIgnoreHttpParams(boolean httpIgnoreParams) - set whether it is enabled or disabled (true means the params will be removed/ignored. This is the default behaviour)
setEnabled
public void setEnabled(boolean enable)
- enable/disable monitoring. Would be better to name them enable and isEnabled, but as far as I could tell tomcat can only initialize
getter and setter methods.
getSize
public int getSize()
getEnabled
public boolean getEnabled()
setSize
public void setSize(int size)
- Set maximum number of rows that can be in jamon before no more records are added. This will prevent jamon from growing unbounded
init
public void init(javax.servlet.FilterConfig arg0)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException