net.sf.mud4j.web.server
Class JettyWebServer

java.lang.Object
  extended by net.sf.mud4j.web.server.JettyWebServer
All Implemented Interfaces:
WebServer

public class JettyWebServer
extends java.lang.Object
implements WebServer

Provide a Jetty webserver that will use classes on the classpath or as specified to configure the container.

Author:
Matthew Purland

Constructor Summary
JettyWebServer(int port)
          Constructor to provide configurable port listener.
 
Method Summary
protected  void configureAndStartServer()
          Configure server servlets and configurations.
 boolean isStarted()
          Whether the web server is started.
 boolean isStopped()
          Whether the web server is stopped.
 void start()
          Start the webserver.
 void stop()
          Stop the webserver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettyWebServer

public JettyWebServer(int port)
Constructor to provide configurable port listener.

Parameters:
port - Port to listen on.
Method Detail

configureAndStartServer

protected void configureAndStartServer()
                                throws java.io.IOException
Configure server servlets and configurations.

Throws:
java.io.IOException - in case of Jetty configuration setup problem

start

public void start()
           throws java.io.IOException
Start the webserver.

Specified by:
start in interface WebServer
Throws:
java.io.IOException - in case of I/O problems or the server won't start.

stop

public void stop()
          throws java.io.IOException
Stop the webserver.

Specified by:
stop in interface WebServer
Throws:
java.io.IOException - in case of I/O problems or if it can't stop the server.

isStarted

public boolean isStarted()
Whether the web server is started.

Specified by:
isStarted in interface WebServer
Returns:
Returns whether the web server is currently started.

isStopped

public boolean isStopped()
Whether the web server is stopped.

Specified by:
isStopped in interface WebServer


Copyright © 2006-2007 mud4j. All Rights Reserved.