org.placelab.example
Class ServletExample

java.lang.Object
  extended byorg.placelab.example.ServletExample
All Implemented Interfaces:
EstimateListener, Servlet

public class ServletExample
extends java.lang.Object
implements Servlet, EstimateListener

This sample creates a placelab object and installs a servlet in it.


Constructor Summary
ServletExample()
           
 
Method Summary
 void estimateUpdated(Tracker t, Estimate e, Measurement m)
          Implement this method to respond to updates from the Tracker(s) you are registered with.
 java.lang.String getName()
          Servlets can have human readable names.
 java.util.Hashtable injectHeaders(HTTPRequest req)
          lets a servlet inject headers into a request that's handled by anybody
static void main(java.lang.String[] args)
           
 HTTPResponse serviceRequest(HTTPRequest req)
          A serlvet must reply to passed in http requests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletExample

public ServletExample()
Method Detail

main

public static void main(java.lang.String[] args)

estimateUpdated

public void estimateUpdated(Tracker t,
                            Estimate e,
                            Measurement m)
Description copied from interface: EstimateListener
Implement this method to respond to updates from the Tracker(s) you are registered with.

Specified by:
estimateUpdated in interface EstimateListener
Parameters:
t - the Tracker producing the Estimate
e - the Estimate produced by the Tracker
m - the latest Measurement used by the Tracker to produce the Estimate

getName

public java.lang.String getName()
Description copied from interface: Servlet
Servlets can have human readable names. This is just for convenience.

Specified by:
getName in interface Servlet

serviceRequest

public HTTPResponse serviceRequest(HTTPRequest req)
Description copied from interface: Servlet
A serlvet must reply to passed in http requests

Specified by:
serviceRequest in interface Servlet

injectHeaders

public java.util.Hashtable injectHeaders(HTTPRequest req)
Description copied from interface: Servlet
lets a servlet inject headers into a request that's handled by anybody

Specified by:
injectHeaders in interface Servlet
Parameters:
req -
Returns:
null if you don't want to inject headers, or a Hashtable of headers/values if you do