public class HTTPServletStarter extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT_NUMBER
The default port number.
|
Constructor and Description |
---|
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(File warFile,
int port,
boolean deamon,
int loaderMode)
Creates a new
HTTPServletStarter for the specified servlet
class, 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. |
public static final int DEFAULT_PORT_NUMBER
public HTTPServletStarter(File warFile) throws Exception
HTTPServletStarter
for the specified WAR
file, on the default port, as a daemon thread.
A listener is started on the port immediately.
warFile
- the WAR file of the application to deploy, cannot be
null
.ServletException
- if the servlet cannot be initialized.IOException
- if the servlet container cannot be started.Exception
public HTTPServletStarter(File warFile, int port) throws Exception
HTTPServletStarter
for the specified WAR
file, on the specified port, as a daemon thread.
A listener is started on the port immediately.
warFile
- the WAR file of the application to deploy, cannot be
null
.port
- the port to run the web server on.ServletException
- if the servlet cannot be initialized.IOException
- if the servlet container cannot be started.Exception
public HTTPServletStarter(File warFile, int port, boolean deamon) throws Exception
HTTPServletStarter
for the specified WAR
file, on the specified port, optionally as a daemon thread.
A listener is started on the port immediately.
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.ServletException
- if the servlet cannot be initialized.IOException
- if the servlet container cannot be started.Exception
public HTTPServletStarter(File warFile, int port, boolean deamon, int loaderMode) throws Exception
HTTPServletStarter
for the specified servlet
class, on the specified port, optionally as a daemon thread.
A listener is started on the port immediately.
warFile
- The war file containing the API, 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.loaderMode
- the way the ClassLoader should locate and load the classes.
See ServletClassLoader
.ServletException
- if the servlet cannot be initialized.IOException
- if the servlet container cannot be started.Exception
public HTTPServletStarter(String servletClassName, int port, boolean deamon) throws Exception
HTTPServletStarter
for the specified servlet
class, on the specified port, optionally as a daemon thread.
A listener is started on the port immediately.
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.ServletException
- if the servlet cannot be initialized.IOException
- if the servlet container cannot be started.Exception
public static void main(String[] args)
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/.