org.terrier.utility
Class SimpleJettyHTTPServer

java.lang.Object
  extended by org.terrier.utility.SimpleJettyHTTPServer

public class SimpleJettyHTTPServer
extends java.lang.Object

Class to make a simple Jetty servlet. Two arguments: port name, and webapps root path. share/images is automatically added as /images.

Since:
3.0
Author:
craigm

Field Summary
protected  org.mortbay.jetty.Server webserver
           
 
Constructor Summary
SimpleJettyHTTPServer(java.lang.String bindAddress, int port, java.lang.String webappRoot)
          Create a new server, bound to the specified IP address (optional), the specified port, and serving from the specified directory
 
Method Summary
static void main(java.lang.String[] args)
          main
 void start()
          start webserver
 void stop()
          stop webserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

webserver

protected org.mortbay.jetty.Server webserver
Constructor Detail

SimpleJettyHTTPServer

public SimpleJettyHTTPServer(java.lang.String bindAddress,
                             int port,
                             java.lang.String webappRoot)
                      throws java.io.IOException
Create a new server, bound to the specified IP address (optional), the specified port, and serving from the specified directory

Parameters:
bindAddress - - interface to bind to. Will bind to all addresses if null.
port - - port to run the Jetty server on.
webappRoot - - path location to run the webapps folder
Throws:
java.io.IOException - if problem in binding
Method Detail

start

public void start()
           throws java.lang.Exception
start webserver

Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.InterruptedException
stop webserver

Throws:
java.lang.InterruptedException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main

Parameters:
args -
Throws:
java.lang.Exception


Terrier 3.5. Copyright © 2004-2011 University of Glasgow