Component that loads a Servlet and provides
the SimpleServletSupport .
Usage in an ".ini" file is:
...
plugin = <this-class>(<servlet-class>, <path>)
...
where
<this-class>
is "org.cougaar.core.servlet.SimpleServletComponent"
<servlet-class>
is the class name of a Servlet.
The servlet must have a zero-argument constructor.
If the Servlet has a
public void setSimpleServletSupport(SimpleServletSupport support)
method then a SimpleServletSupport is passed, which provides
limited access to Cougaar internals.
<path>
is the path for the Servlet, such as "/test".
Most of this code is "reflection-glue" to:
- capture the (classname, path) parameters
- construct the class instance
- examine the class's method(s)
- setup and create a
SimpleServletSupportImpl
instance
Most subclass developers have the classname and path hard-coded,
so they should consider not extending SimpleServletComponent and
instead use BaseServletComponent . The additional
benefit is that subclasses of BaseServletComponent have full
access to the ServiceBroker.
See Also: SimpleServletSupport |