org.cougaar.core.servlet
Class ComponentServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.cougaar.core.servlet.ComponentServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, org.cougaar.core.component.Component, org.cougaar.util.GenericStateModel
Direct Known Subclasses:
AEViewerServlet, CheckJarsServlet, ComponentViewServlet, PingServlet, QuiescenceStateServlet, WhitePagesServlet

public abstract class ComponentServlet
extends javax.servlet.http.HttpServlet
implements org.cougaar.core.component.Component

Abstract base-class for a Component that is also a Servlet.

This is very similar to BaseServletComponent, except that the component itself is registered as the servlet.

See Also:
Serialized Form

Field Summary
protected  MessageAddress agentId
           
protected  AgentIdentificationService agentIdService
           
protected  org.cougaar.core.component.BindingSite bindingSite
           
protected  java.lang.String encAgentName
           
protected  org.cougaar.core.component.ServiceBroker serviceBroker
           
protected  ServletService servletService
           
 
Fields inherited from interface org.cougaar.util.GenericStateModel
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED
 
Constructor Summary
ComponentServlet()
           
 
Method Summary
protected  MessageAddress getAgentIdentifier()
           
protected  java.lang.String getEncodedAgentName()
          URL-encoded name of the local agent
 int getModelState()
           
protected  java.lang.String getPath()
          Get the path for the Servlet's registration.
protected  org.cougaar.core.component.ServiceBroker getServiceBroker()
           
 void halt()
           
 void initialize()
           
 void load()
           
 void resume()
           
 void setAgentIdentificationService(AgentIdentificationService agentIdService)
           
 void setBindingSite(org.cougaar.core.component.BindingSite bindingSite)
           
 void setParameter(java.lang.Object o)
          Capture the (optional) load-time parameters.
 void setServiceBroker(org.cougaar.core.component.ServiceBroker sb)
           
 void start()
           
 void stop()
           
 void suspend()
           
 void unload()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bindingSite

protected org.cougaar.core.component.BindingSite bindingSite

serviceBroker

protected org.cougaar.core.component.ServiceBroker serviceBroker

servletService

protected ServletService servletService

agentIdService

protected AgentIdentificationService agentIdService

agentId

protected MessageAddress agentId

encAgentName

protected java.lang.String encAgentName
Constructor Detail

ComponentServlet

public ComponentServlet()
Method Detail

setParameter

public void setParameter(java.lang.Object o)
Capture the (optional) load-time parameters.

This is typically a List of Strings.


getPath

protected java.lang.String getPath()
Get the path for the Servlet's registration.

Typically supplied by the component parameter, but subclasses can hard-code the path by overriding this method.


getAgentIdentifier

protected MessageAddress getAgentIdentifier()

getEncodedAgentName

protected java.lang.String getEncodedAgentName()
URL-encoded name of the local agent


setBindingSite

public void setBindingSite(org.cougaar.core.component.BindingSite bindingSite)

setServiceBroker

public void setServiceBroker(org.cougaar.core.component.ServiceBroker sb)

getServiceBroker

protected org.cougaar.core.component.ServiceBroker getServiceBroker()

setAgentIdentificationService

public void setAgentIdentificationService(AgentIdentificationService agentIdService)

initialize

public void initialize()
                throws org.cougaar.util.StateModelException
Specified by:
initialize in interface org.cougaar.util.GenericStateModel
Throws:
org.cougaar.util.StateModelException

load

public void load()
Specified by:
load in interface org.cougaar.util.GenericStateModel

start

public void start()
           throws org.cougaar.util.StateModelException
Specified by:
start in interface org.cougaar.util.GenericStateModel
Throws:
org.cougaar.util.StateModelException

suspend

public void suspend()
             throws org.cougaar.util.StateModelException
Specified by:
suspend in interface org.cougaar.util.GenericStateModel
Throws:
org.cougaar.util.StateModelException

resume

public void resume()
            throws org.cougaar.util.StateModelException
Specified by:
resume in interface org.cougaar.util.GenericStateModel
Throws:
org.cougaar.util.StateModelException

stop

public void stop()
          throws org.cougaar.util.StateModelException
Specified by:
stop in interface org.cougaar.util.GenericStateModel
Throws:
org.cougaar.util.StateModelException

halt

public void halt()
          throws org.cougaar.util.StateModelException
Specified by:
halt in interface org.cougaar.util.GenericStateModel
Throws:
org.cougaar.util.StateModelException

getModelState

public int getModelState()
Specified by:
getModelState in interface org.cougaar.util.GenericStateModel

unload

public void unload()
Specified by:
unload in interface org.cougaar.util.GenericStateModel