FileDocCategorySizeDatePackage
AbstractTomcatTask.javaAPI DocExample2742Sat Mar 15 19:39:56 GMT 2003com.oreilly.javaxp.tomcat.tasks

AbstractTomcatTask

public abstract class AbstractTomcatTask extends org.apache.tools.ant.Task
author
Brian M. Coyner
version
$Id: AbstractTomcatTask.java,v 1.4 2003/02/27 00:29:33 jepc Exp $

Fields Summary
private TomcatSupport
tomcatSupport
Constructors Summary
Methods Summary
public voidexecute()
Called by Ant to start the execution of the target.

        this.tomcatSupport.execute();
    
public abstract java.lang.StringgetScriptToExecute()

return
the name of the script to execute. For Tomcat 4.0 and higher a valid filename might be 'startup'. The name of the script should not include the extension.

public voidinit()
Overrides the base class implementation to instantiate the TomcatSupport class.

        this.tomcatSupport =
                new TomcatSupport(this, getScriptToExecute(), isStarting());
    
public abstract booleanisStarting()

return
true if Tomcat is being started; false if Tomcat is being stopped.

public voidsetCatalinaHome(java.lang.String catalinaHome)
Called by Ant to set the attribute 'catalinaHome'. This attribute is referenced in the buildfile.

param
catalinaHome the full path to where Tomcat is installed.

        this.tomcatSupport.setCatalinaHome(catalinaHome);
    
public voidsetTestURL(java.lang.String testURL)
Called by Ant to set the attribute 'testURL'. This attribute is referenced in the buildfile.

param
testURL a URL that is used to connect to Tomcat. This URL is used to validate that Tomcat is running.

        this.tomcatSupport.setTestURL(testURL);
    
public voidsetTimeout(java.lang.String timeout)

param
timeout a number representing the timeout in milliseconds. The timeout must be greater than 10 seconds (10000 ms) and less than 60 seconds (60000 ms).

        try {
            long temp = Long.parseLong(timeout);
            if (temp >= 10000 && temp <= 60000) {
                this.tomcatSupport.setTimeout(temp);
            } else {
                throw new BuildException("Invalid 'timeout' value: "
                                         + timeout + ". The timeout must be between " +
                                         "10000 and 60000.");
            }
        } catch (NumberFormatException nfe) {
            throw new BuildException("Invalid 'timeout' value: " + timeout);
        }