net.java.dev.moskito.web
Class MoskitoHttpServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by net.java.dev.moskito.web.MoskitoHttpServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig, IStatsProducer

public class MoskitoHttpServlet
extends HttpServlet
implements IStatsProducer

See Also:
Serialized Form

Field Summary
private  List<IStats> cachedStatList
           
private  ServletStats deleteStats
           
private  ServletStats getStats
           
private  ServletStats headStats
           
private  ServletStats lastModifiedStats
           
private  ServletStats optionsStats
           
private  ServletStats postStats
           
private  ServletStats putStats
           
private  ServletStats traceStats
           
 
Constructor Summary
MoskitoHttpServlet()
           
 
Method Summary
protected  void doDelete(HttpServletRequest req, HttpServletResponse res)
           
protected  void doGet(HttpServletRequest req, HttpServletResponse res)
           
protected  void doHead(HttpServletRequest req, HttpServletResponse res)
           
protected  void doOptions(HttpServletRequest req, HttpServletResponse res)
           
protected  void doPost(HttpServletRequest req, HttpServletResponse res)
           
protected  void doPut(HttpServletRequest req, HttpServletResponse res)
           
protected  void doTrace(HttpServletRequest req, HttpServletResponse res)
           
 String getCategory()
           
protected  long getLastModified(HttpServletRequest req)
           
protected  Interval[] getMonitoringIntervals()
           
 String getProducerId()
          Returns the producer id.
 List<IStats> getStats()
           
 String getSubsystem()
           
 void init(ServletConfig config)
           
protected  void moskitoDoDelete(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoDoGet(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoDoHead(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoDoOptions(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoDoPost(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoDoPut(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoDoTrace(HttpServletRequest req, HttpServletResponse res)
           
protected  long moskitoGetLastModified(HttpServletRequest req)
           
protected  boolean useShortStatList()
          Override this method and return true, if you want the short list of stats (doGet and doPost only).
 
Methods inherited from class javax.servlet.http.HttpServlet
service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, 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

deleteStats

private ServletStats deleteStats

getStats

private ServletStats getStats

headStats

private ServletStats headStats

optionsStats

private ServletStats optionsStats

postStats

private ServletStats postStats

putStats

private ServletStats putStats

traceStats

private ServletStats traceStats

lastModifiedStats

private ServletStats lastModifiedStats

cachedStatList

private List<IStats> cachedStatList
Constructor Detail

MoskitoHttpServlet

public MoskitoHttpServlet()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Throws:
ServletException

doDelete

protected final void doDelete(HttpServletRequest req,
                              HttpServletResponse res)
                       throws ServletException,
                              IOException
Overrides:
doDelete in class HttpServlet
Throws:
ServletException
IOException

doGet

protected final void doGet(HttpServletRequest req,
                           HttpServletResponse res)
                    throws ServletException,
                           IOException
Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException

doHead

protected final void doHead(HttpServletRequest req,
                            HttpServletResponse res)
                     throws ServletException,
                            IOException
Overrides:
doHead in class HttpServlet
Throws:
ServletException
IOException

doOptions

protected final void doOptions(HttpServletRequest req,
                               HttpServletResponse res)
                        throws ServletException,
                               IOException
Overrides:
doOptions in class HttpServlet
Throws:
ServletException
IOException

doPost

protected final void doPost(HttpServletRequest req,
                            HttpServletResponse res)
                     throws ServletException,
                            IOException
Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException

doPut

protected final void doPut(HttpServletRequest req,
                           HttpServletResponse res)
                    throws ServletException,
                           IOException
Overrides:
doPut in class HttpServlet
Throws:
ServletException
IOException

doTrace

protected final void doTrace(HttpServletRequest req,
                             HttpServletResponse res)
                      throws ServletException,
                             IOException
Overrides:
doTrace in class HttpServlet
Throws:
ServletException
IOException

getLastModified

protected final long getLastModified(HttpServletRequest req)
Overrides:
getLastModified in class HttpServlet

moskitoDoDelete

protected void moskitoDoDelete(HttpServletRequest req,
                               HttpServletResponse res)
                        throws ServletException,
                               IOException
Throws:
ServletException
IOException

moskitoDoGet

protected void moskitoDoGet(HttpServletRequest req,
                            HttpServletResponse res)
                     throws ServletException,
                            IOException
Throws:
ServletException
IOException

moskitoDoHead

protected void moskitoDoHead(HttpServletRequest req,
                             HttpServletResponse res)
                      throws ServletException,
                             IOException
Throws:
ServletException
IOException

moskitoDoOptions

protected void moskitoDoOptions(HttpServletRequest req,
                                HttpServletResponse res)
                         throws ServletException,
                                IOException
Throws:
ServletException
IOException

moskitoDoPost

protected void moskitoDoPost(HttpServletRequest req,
                             HttpServletResponse res)
                      throws ServletException,
                             IOException
Throws:
ServletException
IOException

moskitoDoPut

protected void moskitoDoPut(HttpServletRequest req,
                            HttpServletResponse res)
                     throws ServletException,
                            IOException
Throws:
ServletException
IOException

moskitoDoTrace

protected void moskitoDoTrace(HttpServletRequest req,
                              HttpServletResponse res)
                       throws ServletException,
                              IOException
Throws:
ServletException
IOException

moskitoGetLastModified

protected long moskitoGetLastModified(HttpServletRequest req)

getProducerId

public String getProducerId()
Returns the producer id. Override this method if you want a useful name in your logs. Default is class name.

Specified by:
getProducerId in interface IStatsProducer

getStats

public List<IStats> getStats()
Specified by:
getStats in interface IStatsProducer

useShortStatList

protected boolean useShortStatList()
Override this method and return true, if you want the short list of stats (doGet and doPost only). Return false if you want the full list, containing get, post, lastModified, put, trace, options, head and delete. Default is true.

Returns:

getMonitoringIntervals

protected Interval[] getMonitoringIntervals()

getCategory

public String getCategory()
Specified by:
getCategory in interface IStatsProducer

getSubsystem

public String getSubsystem()
Specified by:
getSubsystem in interface IStatsProducer


Copyright © 2006 MoSKito Project Team. All Rights Reserved.
MoSKito, the open source java monitoring framework