org.xerial.tomcat
Class TomcatServer

java.lang.Object
  extended by org.xerial.tomcat.TomcatServer

public class TomcatServer
extends Object

Embedded Tomcat Server

Author:
leo

Constructor Summary
TomcatServer(int port)
          Creates a TomcatServer instance with the specified port
TomcatServer(TomcatServerConfiguration configuration)
          Configures the tomcat server
 
Method Summary
 void addContext(String contextPath, String docBase)
           
 File findDir(String resourceName)
           
static void main(String[] args)
          entry point for running Tomcat from CUI
 void registerWAR(String contextPath, String pathToTheWarFile)
           
 void start()
          Starts the tomcat server
 void stop()
          Stops the tomcat server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TomcatServer

public TomcatServer(int port)
Creates a TomcatServer instance with the specified port

Parameters:
port - port used by the tomcat

TomcatServer

public TomcatServer(TomcatServerConfiguration configuration)
Configures the tomcat server

Parameters:
configuration - configuration parameters
Method Detail

main

public static void main(String[] args)
entry point for running Tomcat from CUI

Parameters:
args -

start

public void start()
           throws TomcatException
Starts the tomcat server

Throws:
TomcatException - when failed to launch tomcat

registerWAR

public void registerWAR(String contextPath,
                        String pathToTheWarFile)
                 throws TomcatException
Throws:
TomcatException

addContext

public void addContext(String contextPath,
                       String docBase)
                throws TomcatException
Throws:
TomcatException

stop

public void stop()
          throws TomcatException
Stops the tomcat server

Throws:
TomcatException - failed to stop tomcat

findDir

public File findDir(String resourceName)


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.