org.cougaar.pizza.servlet
Class PizzaPreferenceServlet

java.lang.Object
  extended byorg.cougaar.util.GenericStateModelAdapter
      extended byorg.cougaar.core.servlet.BaseServletComponent
          extended byorg.cougaar.pizza.servlet.PizzaPreferenceServlet
All Implemented Interfaces:
org.cougaar.core.component.Component, org.cougaar.util.GenericStateModel

public class PizzaPreferenceServlet
extends org.cougaar.core.servlet.BaseServletComponent

The main UI for the application: shows collected RSVPs from invited guests at "/pizza", and the progress on ordering the pizza.

Load into the Agent doing the inviting (has the PizzaPreferences object). In our case, that is Alice.


Nested Class Summary
protected  class PizzaPreferenceServlet.PizzaFormatter
          Worker class that actually produces HTML for the servlet.
protected  class PizzaPreferenceServlet.PizzaWorker
          Inner class that's registered as the servlet.
 
Field Summary
protected  java.lang.String agentID
           
protected  org.cougaar.core.service.BlackboardQueryService blackboardQueryService
           
protected  org.cougaar.core.service.LoggingService logger
           
 
Fields inherited from class org.cougaar.core.servlet.BaseServletComponent
bindingSite, serviceBroker, servletService
 
Fields inherited from interface org.cougaar.util.GenericStateModel
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED
 
Constructor Summary
PizzaPreferenceServlet()
           
 
Method Summary
protected  javax.servlet.Servlet createServlet()
          Using an inner class to implement the Servlet interface provides a useful design pattern.
protected  java.lang.String getPath()
          This servlet listens at "/pizza".
 void load()
          Load services needed by this servlet: BlackboardQueryService, AgentIDService.
 void unload()
          Whenever you have a load() method, you should have an unload, to release services.
 
Methods inherited from class org.cougaar.core.servlet.BaseServletComponent
setBindingSite, setParameter, setServiceBroker
 
Methods inherited from class org.cougaar.util.GenericStateModelAdapter
getModelState, halt, initialize, resume, start, stop, suspend, transitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cougaar.util.GenericStateModel
getModelState, halt, initialize, resume, start, stop, suspend
 

Field Detail

blackboardQueryService

protected org.cougaar.core.service.BlackboardQueryService blackboardQueryService

logger

protected org.cougaar.core.service.LoggingService logger

agentID

protected java.lang.String agentID
Constructor Detail

PizzaPreferenceServlet

public PizzaPreferenceServlet()
Method Detail

load

public void load()
Load services needed by this servlet: BlackboardQueryService, AgentIDService. Uses the BlackboardQueryService to get a snapshot of the blackboard status when a user asks, and the AgentIDService to get this agent's name.


unload

public void unload()
Whenever you have a load() method, you should have an unload, to release services.


getPath

protected java.lang.String getPath()
This servlet listens at "/pizza".


createServlet

protected javax.servlet.Servlet createServlet()
Using an inner class to implement the Servlet interface provides a useful design pattern.