org.formaria.http
Class HttpServer

java.lang.Object
  extended by org.formaria.http.HttpServer

public class HttpServer
extends java.lang.Object

A minimal http server, designed so that a server side application can signal a client to do an action by making an http request.

This server does not use NIO so as to be compatible with early JDKs, but this should not be an issue as being a minimla server the class is designed for low volumes of requests

Copyright (c) Formaria Ltd., 2008, see license.txt for details


Field Summary
static java.lang.String BAD_REQUEST
           
static java.lang.String INTERNAL_ERROR
           
static java.lang.String OK
           
 
Constructor Summary
HttpServer(int port, HttpResponseHandler handler)
          Creates a new instance of HttpServer
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final java.lang.String OK
See Also:
Constant Field Values

BAD_REQUEST

public static final java.lang.String BAD_REQUEST
See Also:
Constant Field Values

INTERNAL_ERROR

public static final java.lang.String INTERNAL_ERROR
See Also:
Constant Field Values
Constructor Detail

HttpServer

public HttpServer(int port,
                  HttpResponseHandler handler)
           throws java.io.IOException
Creates a new instance of HttpServer

Parameters:
port - the port number
Throws:
java.io.IOException - if the port cannot be used, or is already in use.