SECTION: 200-General TITLE: Arch QUESTION: What is the Jetty Architecture? This architecture overview is a little out of date, but the basics are still correct.

- The org.mortbay.http.HttpServer class provides the core HTTP server.
- The org.mortbay.jetty.Server class extends HttpServer with XML configuration and servlet support.
- A JVM may contain one or more HttpServer instances.
- A HttpServer may contain one or more HttpListener instances.
- A HttpServer may contain one or more HttpContext instances (called HandlerContext in Jetty3).
- A HttpServer may contain zero or more UserRealm instances.

- SocketListener is the basic implementation of HttpListener that accepts HTTP connections on a normal socket.
- JsseListener is an extension of SocketListener that accepts HTTPS connections using a JSSE SSL implementation.
- HttpListener implementations create HttpConnection instances.
- A HttpConnection instance manages one or more requests received over a connection.

- A HttpContext has attributes for class path, class loader and resource base, which apply to all the HttpHandlers it contains.
- A HttpContext is registered in the HttpServer at one and only one context pattern (eg. /context/*) and for zero or more virtual hosts.
- A HttpContext contains one or more implementation of HttpHandler, in the order they are added.

- ResourceHandler is an implementation of HttpHandler that serves static content from the resource base of the HttpContext.
- ServletHandler is an implementation of HttpHandler that serves Servlets by mapping a pathspec within the context (eg *.xxx, / or /XX/* ) to a Servlet instance. Dynamic servlets include the class name in the URL, configured servlets have explicit path to class mappings.
- A WebApplication is a specialization of HttpContext that uses a web.xml file to configure the context, including a ResourceHandler and a ServletHandler.