de.danielnaber.languagetool.server
Class HTTPServer

Object
  extended by ContentOracle
      extended by HTTPServer

public class HTTPServer
extends ContentOracle

A small embedded HTTP server that checks text. Returns XML, prints debugging to stdout/stderr.

Author:
Daniel Naber

Field Summary
static int DEFAULT_PORT
          The default port on which the server is running (8081).
 
Constructor Summary
HTTPServer()
          Prepare a server - use run() to start it.
HTTPServer(int port)
          Prepare a server on the given port - use run() to start it.
HTTPServer(int port, boolean verbose)
          Prepare a server on the given port - use run() to start it.
 
Method Summary
 String demultiplex(Request connRequest, Response connResponse)
           
static void main(String[] args)
          Start the server from command line.
 void run()
          Start the server.
 void stop()
          Stop the server process.
 
Methods inherited from class ContentOracle
getDelegatedOracle, Instance
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
The default port on which the server is running (8081).

See Also:
Constant Field Values
Constructor Detail

HTTPServer

public HTTPServer()
Prepare a server - use run() to start it.


HTTPServer

public HTTPServer(int port)
Prepare a server on the given port - use run() to start it.


HTTPServer

public HTTPServer(int port,
                  boolean verbose)
Prepare a server on the given port - use run() to start it.

Parameters:
verbose - if true, the text to check will be displayed in case of exceptions (default: false)
Method Detail

run

public void run()
Start the server.


demultiplex

public String demultiplex(Request connRequest,
                          Response connResponse)
Overrides:
demultiplex in class ContentOracle

stop

public void stop()
Stop the server process.


main

public static void main(String[] args)
Start the server from command line. Usage: HTTPServer [-v|--verbose] [-p|--port port]



Copyright © 2005-2007 Daniel Naber