org.mortbay.jetty.plus

Class Server

Implemented Interfaces:
EventProvider, LifeCycle, Serializable

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(URL configuration)
Constructor.
Server(Resource configuration)
Constructor.

Method Summary

void
addService(Service service)
Add a Service to a Server.
protected void
doStart()
Start all handlers then listeners.
protected void
doStop()
Stop all listeners then all contexts.
static void
main(String[] arg)
Construct server from command line arguments.
protected WebApplicationContext
newWebApplicationContext(String webApp)
Create a new WebApplicationContext.

Methods inherited from class org.mortbay.jetty.Server

addWebApplication, addWebApplication, addWebApplications, addWebApplications, addWebApplications, addWebApplications, addWebApplications, configure, getConfiguration, getRootWebApp, getStopAtShutdown, getWebApplicationConfigurationClassNames, main, newHttpContext, newWebApplicationContext, setRootWebApp, setStopAtShutdown, setWebApplicationConfigurationClassNames

Methods inherited from class org.mortbay.http.HttpServer

addContext, addContext, addContext, addContext, addHostAlias, addListener, addListener, addListener, addRealm, destroy, doStart, doStop, findHandler, getConnections, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpen, getConnectionsOpenMax, getConnectionsOpenMin, getConnectionsRequestsAve, getConnectionsRequestsMax, getConnectionsRequestsMin, getContext, getContext, getContext, getContexts, getErrors, getHostMap, getHttpServerList, getHttpServers, getListeners, getRealm, getRequestLog, getRequests, getRequestsActive, getRequestsActiveMax, getRequestsActiveMin, getRequestsDurationAve, getRequestsDurationMax, getRequestsDurationMin, getRequestsDurationTotal, getRequestsPerGC, getResolveRemoteHost, getServerClasses, getStatsOn, getStatsOnMs, getStopGracefully, getSystemClasses, getTrace, join, main, newHttpContext, removeContext, removeListener, removeRealm, save, service, setAnonymous, setContexts, setListeners, setRequestLog, setRequestsPerGC, setResolveRemoteHost, setServerClasses, setStatsOn, setStopGracefully, setSystemClasses, setTrace, statsReset, stop

Methods inherited from class org.mortbay.util.Container

addComponent, addEventListener, destroy, doStart, doStop, getComponents, isStarted, isStarting, isStopping, removeComponent, removeEventListener, start, stop

Constructor Details

Server

public Server()
Constructor.

Server

public Server(String configuration)
            throws IOException
Constructor.
Parameters:
configuration - The filename or URL of the XML configuration file.

Server

public Server(URL configuration)
            throws IOException
Constructor.
Parameters:
configuration - The filename or URL of the XML configuration file.

Server

public Server(Resource configuration)
            throws IOException
Constructor.
Parameters:
configuration - The filename or URL of the XML configuration file.

Method Details

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()
            throws Exception
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.
Overrides:
doStart in interface HttpServer

doStop

protected void doStop()
            throws InterruptedException
Stop all listeners then all contexts.
Overrides:
doStop in interface HttpServer
Parameters:

main

public static void main(String[] arg)
Construct server from command line arguments.
Overrides:
main in interface Server
Parameters:

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.
Overrides:
newWebApplicationContext in interface Server
Parameters:
webApp - The Web application directory or WAR file.
Returns:
WebApplicationContext

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