com.adventnet.adaptors.html
Class TomcatServer

java.lang.Object
  extended by com.adventnet.adaptors.html.TomcatServer

public class TomcatServer
extends java.lang.Object

Starter for Tomcat using XML.


Field Summary
(package private)  java.lang.String configFile
           
(package private) static java.lang.String DEFAULT_CONFIG
           
(package private)  boolean doStop
           
 
Constructor Summary
TomcatServer()
           
 
Method Summary
 void execute(java.lang.String[] args)
           
static void generateServerConfig(org.apache.tomcat.core.ContextManager cm)
          This method will generate Server config files that reflect the existing cm settings.
(package private)  java.io.File getConfigFile(org.apache.tomcat.core.ContextManager cm)
          Return the configuration file we are processing.
 org.apache.tomcat.core.ContextManager getContextManager()
           
static void printUsage()
           
 boolean processArgs(java.lang.String[] args)
          Process arguments - set object properties from the list of args.
(package private)  void setConnectorHelper(org.apache.tomcat.util.xml.XmlMapper xh)
           
(package private)  void setHelper(org.apache.tomcat.util.xml.XmlMapper xh)
           
(package private)  void setLogHelper(org.apache.tomcat.util.xml.XmlMapper xh)
          Setup loggers when reading the configuration file - this will be called only when starting tomcat as deamon, all other modes will output to stderr
 void stop()
          Stop tomcat using the configured cm The manager is set up using the same configuration file, so it will have the same port as the original instance ( no need for a "log" file).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configFile

java.lang.String configFile

DEFAULT_CONFIG

static final java.lang.String DEFAULT_CONFIG
See Also:
Constant Field Values

doStop

boolean doStop
Constructor Detail

TomcatServer

public TomcatServer()
Method Detail

getContextManager

public org.apache.tomcat.core.ContextManager getContextManager()

setHelper

void setHelper(org.apache.tomcat.util.xml.XmlMapper xh)

setConnectorHelper

void setConnectorHelper(org.apache.tomcat.util.xml.XmlMapper xh)

setLogHelper

void setLogHelper(org.apache.tomcat.util.xml.XmlMapper xh)
Setup loggers when reading the configuration file - this will be called only when starting tomcat as deamon, all other modes will output to stderr


getConfigFile

java.io.File getConfigFile(org.apache.tomcat.core.ContextManager cm)
Return the configuration file we are processing. If the -config filename command line argument is not used, the default configuration filename will be loaded from the TOMCAT_HOME directory. If a relative config file is used, it will be relative to the current working directory.

Parameters:
cm - The ContextManager we are configuring

execute

public void execute(java.lang.String[] args)
             throws java.lang.Exception
Throws:
java.lang.Exception

generateServerConfig

public static void generateServerConfig(org.apache.tomcat.core.ContextManager cm)
                                 throws org.apache.tomcat.core.TomcatException
This method will generate Server config files that reflect the existing cm settings. It is called at startup, and may be called when a new context is added ( at runtime for example ).

Throws:
org.apache.tomcat.core.TomcatException

stop

public void stop()
          throws java.lang.Exception
Stop tomcat using the configured cm The manager is set up using the same configuration file, so it will have the same port as the original instance ( no need for a "log" file). It uses the Ajp12 connector, which has a built-in "stop" method, that will change when we add real callbacks ( it's equivalent with the previous RMI method from almost all points of view )

Throws:
java.lang.Exception

printUsage

public static void printUsage()

processArgs

public boolean processArgs(java.lang.String[] args)
Process arguments - set object properties from the list of args.