org.mortbay.jetty.plus

Class Server

public class Server extends Server

The Jetty HttpServer. This specialization of org.mortbay.jetty.Server adds knowledge about JNDI and Transaction Management

Author: Miro Halas

Constructor Summary
Server()
Constructor.
Server(String configuration)
Constructor.
Server(Resource configuration)
Constructor.
Server(URL configuration)
Constructor.
Method Summary
voidaddService(Service service)
Add a Service to a Server.
protected voiddoStart()
Start all handlers then listeners.
protected voiddoStop()
Stop all listeners then all contexts.
static voidmain(String[] arg)
protected WebApplicationContextnewWebApplicationContext(String webApp)
Create a new WebApplicationContext.

Constructor Detail

Server

public Server()
Constructor.

Server

public Server(String configuration)
Constructor.

Parameters: configuration The filename or URL of the XML configuration file.

Server

public Server(Resource configuration)
Constructor.

Parameters: configuration The filename or URL of the XML configuration file.

Server

public Server(URL configuration)
Constructor.

Parameters: configuration The filename or URL of the XML configuration file.

Method Detail

addService

public void addService(Service service)
Add a Service to a Server. Examples are transaction service, mail service etc

Parameters: service eg TMService, MailService

doStart

protected void doStart()
Start all handlers then listeners. If a subcomponent fails to start, it's exception is added to a org.mortbay.util.MultiException and the start method continues.

Throws: MultiException A collection of exceptions thrown by start() method of subcomponents of the HttpServer.

doStop

protected void doStop()
Stop all listeners then all contexts.

Parameters: graceful If true and statistics are on for a context, then this method will wait for requestsActive to go to zero before stopping that context.

main

public static void main(String[] arg)

newWebApplicationContext

protected WebApplicationContext newWebApplicationContext(String webApp)
Create a new WebApplicationContext. Ths method is called by Server to creat new contexts for web applications. Thus calls to addWebApplication that result in a new Context being created will return an correct class instance. Derived class can override this method to create instance of its own class derived from WebApplicationContext in case it needs more functionality.

Parameters: webApp The Web application directory or WAR file.

Returns: WebApplicationContext

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.