net.java.dev.moskitodemo.servlet
Class SimpleServlet

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

public class SimpleServlet
extends MoskitoHttpServlet

This is a simple example how to use moskito in a servlet. Basically it provides all the functionality the simple service provider over web.

Author:
another
See Also:
Serialized Form

Field Summary
static int MODE_ERROR
           
static int MODE_NORMAL_PROCESSING
           
static int MODE_RANDOM
           
private  Random rnd
           
 
Constructor Summary
SimpleServlet()
           
 
Method Summary
 void init()
           
protected  void moskitoDoGet(HttpServletRequest req, HttpServletResponse res)
           
protected  void moskitoShowStats(HttpServletRequest req, HttpServletResponse res)
           
protected  boolean useShortStatList()
           
private  void writeHtmlHead(PrintWriter writer, String title)
           
private  void writeResponse(HttpServletResponse res, int amountOfTimeSlept)
           
 
Methods inherited from class net.java.dev.moskito.web.MoskitoHttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getCategory, getLastModified, getMonitoringIntervals, getProducerId, getStats, getSubsystem, init, moskitoDoDelete, moskitoDoHead, moskitoDoOptions, moskitoDoPost, moskitoDoPut, moskitoDoTrace, moskitoGetLastModified
 
Methods inherited from class javax.servlet.http.HttpServlet
service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_NORMAL_PROCESSING

public static final int MODE_NORMAL_PROCESSING
See Also:
Constant Field Values

MODE_RANDOM

public static final int MODE_RANDOM
See Also:
Constant Field Values

MODE_ERROR

public static final int MODE_ERROR
See Also:
Constant Field Values

rnd

private Random rnd
Constructor Detail

SimpleServlet

public SimpleServlet()
Method Detail

init

public void init()
Overrides:
init in class GenericServlet

moskitoDoGet

protected void moskitoDoGet(HttpServletRequest req,
                            HttpServletResponse res)
                     throws ServletException,
                            IOException
Overrides:
moskitoDoGet in class MoskitoHttpServlet
Throws:
ServletException
IOException

moskitoShowStats

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

useShortStatList

protected boolean useShortStatList()
Overrides:
useShortStatList in class MoskitoHttpServlet

writeResponse

private void writeResponse(HttpServletResponse res,
                           int amountOfTimeSlept)
                    throws IOException
Throws:
IOException

writeHtmlHead

private void writeHtmlHead(PrintWriter writer,
                           String title)


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