|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.perf4j.servlet.AbstractGraphingServlet
public abstract class AbstractGraphingServlet
This servlet class serves as the base class for displaying performance charts in a web environment. This class sets up the framework for sending the HTML response. Subclasses are only responsible for determining how to find the graphs to display by implementing the getGraphByName and getAllKnownGraphNames methods.
Field Summary | |
---|---|
protected java.util.List<java.lang.String> |
graphNames
Setting an init parameter "graphNames" to a comma-separated list of the names of graphs to display by default sets this member variable. |
Constructor Summary | |
---|---|
AbstractGraphingServlet()
|
Method Summary | |
---|---|
void |
destroy()
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected abstract java.util.List<java.lang.String> |
getAllKnownGraphNames()
Subclasses should implement this method to return a list of all possible known graph names. |
protected java.util.Map<java.lang.String,StatisticsChartGenerator> |
getChartGeneratorsToDisplay(javax.servlet.http.HttpServletRequest request)
Helper method generates the list of charts that are to be displayed in this call to the servlet. |
protected abstract StatisticsChartGenerator |
getGraphByName(java.lang.String name)
Subclasses should implement this method to return a chart generator by its name. |
void |
init()
|
protected void |
writeChart(java.lang.String name,
StatisticsChartGenerator chartGenerator,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Helper method writes the chart to the page using an img tag. |
protected void |
writeFooter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Helper method writes the HTML footer, closing the body and HTML tags. |
protected void |
writeHeader(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Helper method writes the HTML header, everything up to the opening body tag. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<java.lang.String> graphNames
GraphingServlet
uses the names of
GraphingStatisticsAppender
s to determine which graphs to show.
Constructor Detail |
---|
public AbstractGraphingServlet()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
protected void writeHeader(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void writeChart(java.lang.String name, StatisticsChartGenerator chartGenerator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
name
- the name of the chart to writechartGenerator
- the chart generator responsible for creating the chart URLrequest
- the incoming servlet requestresponse
- the servlet respone
javax.servlet.ServletException
java.io.IOException
protected void writeFooter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected java.util.Map<java.lang.String,StatisticsChartGenerator> getChartGeneratorsToDisplay(javax.servlet.http.HttpServletRequest request)
request
- The incoming request, which may contain a list of "graphName" parameters, in which case those
graphs will be displayed
protected abstract StatisticsChartGenerator getGraphByName(java.lang.String name)
name
- the name of the graph to return
protected abstract java.util.List<java.lang.String> getAllKnownGraphNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |