com.jamonapi.http
Class JAMonJettyHandler
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.handler.AbstractHandler
org.mortbay.jetty.handler.AbstractHandlerContainer
org.mortbay.jetty.handler.HandlerWrapper
com.jamonapi.http.JAMonJettyHandler
- All Implemented Interfaces:
- org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler, org.mortbay.jetty.HandlerContainer
public class JAMonJettyHandler
- extends org.mortbay.jetty.handler.HandlerWrapper
Handler that can be used to track request access in jetty. See www.jamonapi.com for more info on how to
add this handler to the jetty.xml file. This is a wrapper class for the true monitoring class of HttpMonFactory.
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler |
_string |
Fields inherited from interface org.mortbay.jetty.Handler |
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST |
Method Summary |
void |
addSummaryLabel(java.lang.String jamonSummaryLabel)
|
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 |
handle(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
int dispatch)
Monitor the request and call any other requests in the decorator chain |
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 org.mortbay.jetty.handler.HandlerWrapper |
addHandler, doStart, doStop, expandChildren, getHandler, setHandler, setServer |
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer |
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler |
destroy, getServer, toString |
Methods inherited from class org.mortbay.component.AbstractLifeCycle |
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mortbay.component.LifeCycle |
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop |
JAMonJettyHandler
public JAMonJettyHandler()
handle
public void handle(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
int dispatch)
throws java.io.IOException,
javax.servlet.ServletException
- Monitor the request and call any other requests in the decorator chain
- Specified by:
handle
in interface org.mortbay.jetty.Handler
- Overrides:
handle
in class org.mortbay.jetty.handler.HandlerWrapper
- 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