org.apache.geronimo.samples.daytrader.web
Class TradeScenarioServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.geronimo.samples.daytrader.web.TradeScenarioServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class TradeScenarioServlet
extends javax.servlet.http.HttpServlet

TradeScenarioServlet emulates a population of web users by generating a specific Trade operation for a randomly chosen user on each access to the URL. Test this servlet by clicking Trade Scenario and hit "Reload" on your browser to step through a Trade Scenario. To benchmark using this URL aim your favorite web load generator (such as AKStress) at the Trade Scenario URL and fire away.

See Also:
Serialized Form

Constructor Summary
TradeScenarioServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process incoming HTTP GET requests
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process incoming HTTP POST requests
 java.lang.String getServletInfo()
          Returns a string that contains information about TradeScenarioServlet
 void init(javax.servlet.ServletConfig config)
          Servlet initialization method.
 void performTask(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Main service method for TradeScenarioServlet
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TradeScenarioServlet

public TradeScenarioServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Servlet initialization method.

Throws:
javax.servlet.ServletException

getServletInfo

public java.lang.String getServletInfo()
Returns a string that contains information about TradeScenarioServlet

Returns:
The servlet information

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Process incoming HTTP GET requests

Parameters:
request - Object that encapsulates the request to the servlet
response - Object that encapsulates the response from the servlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Process incoming HTTP POST requests

Parameters:
request - Object that encapsulates the request to the servlet
response - Object that encapsulates the response from the servlet
Throws:
javax.servlet.ServletException
java.io.IOException

performTask

public void performTask(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse resp)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Main service method for TradeScenarioServlet

Throws:
javax.servlet.ServletException
java.io.IOException


Copyright © 2005-2006 Apache Software Foundation. All Rights Reserved.