org.xins.common.servlet.container
Class HTTPServletStarter

java.lang.Object
  extended byorg.xins.common.servlet.container.HTTPServletStarter

public class HTTPServletStarter
extends Object

HTTP Server used to invoke the XINS Servlet.

Version:
$Revision: 1.9 $ $Date: 2006/10/13 13:28:16 $
Author:
Anthony Goubard

Field Summary
static int DEFAULT_PORT_NUMBER
          The default port number.
 
Constructor Summary
HTTPServletStarter(File warFile)
          Creates a new HTTPServletStarter for the specified WAR file, on the default port, as a daemon thread.
HTTPServletStarter(File warFile, int port)
          Creates a new HTTPServletStarter for the specified WAR file, on the specified port, as a daemon thread.
HTTPServletStarter(File warFile, int port, boolean deamon)
          Creates a new HTTPServletStarter for the specified WAR file, on the specified port, optionally as a daemon thread.
HTTPServletStarter(String servletClassName, int port, boolean deamon)
          Creates a new HTTPServletStarter for the specified servlet class, on the specified port, optionally as a daemon thread.
 
Method Summary
static void main(String[] args)
          Starts the Servlet container for the specific API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT_NUMBER

public static final int DEFAULT_PORT_NUMBER
The default port number.

See Also:
Constant Field Values
Constructor Detail

HTTPServletStarter

public HTTPServletStarter(File warFile)
                   throws ServletException,
                          IOException
Creates a new HTTPServletStarter for the specified WAR file, on the default port, as a daemon thread.

A listener is started on the port immediately.

Parameters:
warFile - the WAR file of the application to deploy, cannot be null.
Throws:
ServletException - if the servlet cannot be initialized.
IOException - if the servlet container cannot be started.

HTTPServletStarter

public HTTPServletStarter(File warFile,
                          int port)
                   throws ServletException,
                          IOException
Creates a new HTTPServletStarter for the specified WAR file, on the specified port, as a daemon thread.

A listener is started on the port immediately.

Parameters:
warFile - the WAR file of the application to deploy, cannot be null.
port - the port to run the web server on.
Throws:
ServletException - if the servlet cannot be initialized.
IOException - if the servlet container cannot be started.

HTTPServletStarter

public HTTPServletStarter(File warFile,
                          int port,
                          boolean deamon)
                   throws ServletException,
                          IOException
Creates a new HTTPServletStarter for the specified WAR file, on the specified port, optionally as a daemon thread.

A listener is started on the port immediately.

Parameters:
warFile - The war file of the application to deploy, cannot be null.
port - The port of the web server, cannot be null.
deamon - true if the thread listening to connection should be a deamon thread, false otherwise.
Throws:
ServletException - if the servlet cannot be initialized.
IOException - if the servlet container cannot be started.

HTTPServletStarter

public HTTPServletStarter(String servletClassName,
                          int port,
                          boolean deamon)
                   throws ServletException,
                          IOException
Creates a new HTTPServletStarter for the specified servlet class, on the specified port, optionally as a daemon thread.

A listener is started on the port immediately.

Parameters:
servletClassName - The name of the servlet to load, cannot be null.
port - The port of the web server, cannot be null.
deamon - true if the thread listening to connection should be a deamon thread, false otherwise.
Throws:
ServletException - if the servlet cannot be initialized.
IOException - if the servlet container cannot be started.
Method Detail

main

public static void main(String[] args)
Starts the Servlet container for the specific API.

Parameters:
args - The command line arguments, the first argument should be the location of the WAR file or the name of the class of the servlet to load, the optional second argument is the port number. If no port number is specified, 8080 is used as default.


See http://www.xins.org/.