| org.cougaar.lib.web.tomcat.EmbeddedTomcat
EmbeddedTomcat | public class EmbeddedTomcat extends Catalina (Code) | | This class wraps the org.apache.catalina.startup.Catalina class to
follow similar behavior as Tomcat 3.3's EmbededTomcat class. The
most important functionality that it handles is reading the server.xml
file and then allowing the caller access to the objects. In specific,
the Connectors needed to be configurable dynamically.
This class inherits from Catalina only to get access to the server objects.
|
Method Summary | |
public void | addEndpoint(int port, Map options) Adds an HTTPConnector to the server. | public void | addEndpoint(int port, InetAddress address, ServerSocketFactory fact, int acceptCount) Adds an HTTP socket connector to the server. | public void | addSecureEndpoint(int port, Map options) Adds an HTTPS socket connector to the server. | public void | addSecureEndpoint(int port, InetAddress address, ServerSocketFactory fact) Adds an HTTPS socket connector to the server. | public void | configure(Map options) Configure the server. | public void | embeddedStart() Starts the web server. | public void | embeddedStop() Stops the web server. | public Engine | getEngine() Returns the Engine object. | public Server | getServer() Returns a reference to the Server object. | public Service | getService() Returns a reference to the Service. | public void | readConfigFile(String configFile) Reads the xml configuration file given. | public void | setInstall(String installPath) | protected void | setRedirectPort(HttpConnector conn) Sets the redirection port all HTTP connections if this is an
HTTPS connection or the redirection port of this connection
if an HTTPS connection exists and this is an HTTP connection. |
EmbeddedTomcat | public EmbeddedTomcat()(Code) | | Default constructor
|
addEndpoint | public void addEndpoint(int port, Map options)(Code) | | Adds an HTTPConnector to the server.
Current valid options:
- "factory"
Optional classname for server socket factory, which
defaults to
"org.apache.catalina.net.DefaultServerSocketFactory"
Parameters: port - The TCP port number to bind to Parameters: options - Map of optional parameters |
addEndpoint | public void addEndpoint(int port, InetAddress address, ServerSocketFactory fact, int acceptCount)(Code) | | Adds an HTTP socket connector to the server.
|
addSecureEndpoint | public void addSecureEndpoint(int port, Map options)(Code) | | Adds an HTTPS socket connector to the server.
Note, if the factory is not specified, then Tomcat
imposes these restrictions:
- The certificate name must be "tomcat".
- The keystore and the truststore must be the
same file.
Current valid options:
- "factory"
Optional classname for server socket factory, which
defaults to
"org.apache.catalina.net.SSLServerSocketFactory"
- "keystore"
Optional file name for the certificate keystore.
- "keypass"
Optional password for the certificate keystore.
- "clientAuth"
If the value is "true", then client authentication
is enabled.
Parameters: port - The TCP port number to bind to Parameters: options - Map of optional parameters |
addSecureEndpoint | public void addSecureEndpoint(int port, InetAddress address, ServerSocketFactory fact)(Code) | | Adds an HTTPS socket connector to the server.
|
configure | public void configure(Map options)(Code) | | Configure the server.
Current valid options:
- "debug"
Optional debug flag, which defaults to "false".
Parameters: options - Map of optional parameters |
embeddedStart | public void embeddedStart() throws LifecycleException(Code) | | Starts the web server.
|
embeddedStop | public void embeddedStop() throws LifecycleException(Code) | | Stops the web server.
|
readConfigFile | public void readConfigFile(String configFile) throws Exception(Code) | | Reads the xml configuration file given. This must be called before
the server is started via embeddedStart.
|
setInstall | public void setInstall(String installPath)(Code) | | Sets the catalina.home and catalina.base paths to the given String
|
setRedirectPort | protected void setRedirectPort(HttpConnector conn)(Code) | | Sets the redirection port all HTTP connections if this is an
HTTPS connection or the redirection port of this connection
if an HTTPS connection exists and this is an HTTP connection.
Parameters: conn - The HTTP to set the redirection port or the HTTPSconnection to set all other connections' redirection ports. |
|
|