Package sunlabs.brazil.server

Generic http protocol stack, essential handlers and drivers.

See:
          Description

Interface Summary
Handler The interface for writing HTTP handlers.
 

Class Summary
ChainHandler Allows multiple handlers to be invoked sequentially for a single HTTP request.
FileHandler Standard handler for fetching static files.
Main Sample main program for starting an http server.
Request Represents an HTTP transaction.
Request.HttpOutputStream The HttpOutputStream provides the convenience method writeBytes for writing the byte representation of a string, without bringing in the overhead and the deprecated warnings associated with a java.io.DataOutputStream.
Server Yet another HTTP/1.1 server.
TestRequest Version of Request for testing purposes.
 

Package sunlabs.brazil.server Description

Generic http protocol stack, essential handlers and drivers.

This package consists of a small server side http protocol stack, designed to be embedded in other applications. The primary classes in this package are Server, Request and Main The remaining classes are in this package either because they are tightly bound to the implementation of the "Server" and "Request" classes, or they are almost always used with the basic server.

The design points are:

Extremely small footprint
Unlike a traditional webserver, designed primarily for serving web documents, this protocol stack is bare-bones, providing only the essentials for manipulating http requests and responses. It supports HTTP/1.0, and the important features of HTTP/1.1.
Small, simple extension API.
The programming interface is designed for simplicity. There are few convenience methods provided, and consequently no bias toward any pre-conceived notions as to what http protocol stacks should be used for.

Classes that implement this API are called handlers, to distinguish them from the moral equivalent, but more complex servlets used by the Java Web Server.

Delegation based object model
Inheritance is used sparingly in favor of delegation. This alleviates the need for base or abstract classes to know what the application has in mind.

To ease the deployment and testing of applications that use the server, two additional capabilities are included: a simple driver (main) program, and a coupler of handler classes, so the protocol stack can be used out of the box to provide a simple file service.


Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.