org.vfny.geoserver
Class EmbeddedTomcat

java.lang.Object
  extended byorg.vfny.geoserver.EmbeddedTomcat

public class EmbeddedTomcat
extends java.lang.Object

This class handles the starting and stopping of the embedded Tomcat server. It does some rudementary checking to make sure that the required filesystem and path variables are in place before it begins.


Constructor Summary
EmbeddedTomcat()
          Default Constructor
 
Method Summary
 java.lang.String getPath()
          Basic Accessor returning the value of the context path
static void main(java.lang.String[] args)
          Handles server creation and destruction.
 void registerWAR(java.lang.String contextPath, java.net.URL warFile)
          Registers a WAR with the container.
 void setPath(java.lang.String path)
          Basic Accessor setting the value of the context path
 void startTomcat()
          Starts the Tomcat server.
 void stopTomcat()
          This method Stops the Tomcat server.
 void unregisterWAR(java.lang.String contextPath)
          Unregisters a WAR from the web server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedTomcat

public EmbeddedTomcat()
Default Constructor

Method Detail

setPath

public void setPath(java.lang.String path)
Basic Accessor setting the value of the context path

Parameters:
path - The catalina server path.

getPath

public java.lang.String getPath()
Basic Accessor returning the value of the context path

Returns:
path The catalina server path.

startTomcat

public void startTomcat()
                 throws java.lang.Exception
Starts the Tomcat server.

Throws:
java.lang.Exception - for any problems

stopTomcat

public void stopTomcat()
                throws java.lang.Exception
This method Stops the Tomcat server.

Throws:
java.lang.Exception - if anything goes wrong.

registerWAR

public void registerWAR(java.lang.String contextPath,
                        java.net.URL warFile)
                 throws java.lang.Exception
Registers a WAR with the container.

Parameters:
contextPath - Path under which the application will be registered
warFile - URL of the WAR to be registered.
Throws:
java.lang.Exception - if anything goes wrong.

unregisterWAR

public void unregisterWAR(java.lang.String contextPath)
                   throws java.lang.Exception
Unregisters a WAR from the web server.

Parameters:
contextPath - - the context path to be removed
Throws:
java.lang.Exception - if anything goes wrong.

main

public static void main(java.lang.String[] args)
Handles server creation and destruction.

Parameters:
args - Arguments from the user (must be 'stop' or 'start').