FileDocCategorySizeDatePackage
Server.javaAPI DocApache Tomcat 6.0.144679Fri Jul 20 04:20:36 BST 2007org.apache.catalina

Server

public interface Server
A Server element represents the entire Catalina servlet container. Its attributes represent the characteristics of the servlet container as a whole. A Server may contain one or more Services, and the top level set of naming resources.

Normally, an implementation of this interface will also implement Lifecycle, such that when the start() and stop() methods are called, all of the defined Services are also started or stopped.

In between, the implementation must open a server socket on the port number specified by the port property. When a connection is accepted, the first line is read and compared with the specified shutdown command. If the command matches, shutdown of the server is initiated.

NOTE - The concrete implementation of this class should register the (singleton) instance with the ServerFactory class in its constructor(s).

author
Craig R. McClanahan
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
Constructors Summary
Methods Summary
public voidaddService(Service service)
Add a new Service to the set of defined Services.

param
service The Service to be added

public voidawait()
Wait until a proper shutdown command is received, then return.

public ServicefindService(java.lang.String name)
Return the specified Service (if it exists); otherwise return null.

param
name Name of the Service to be returned

public Service[]findServices()
Return the set of Services defined within this Server.

public org.apache.catalina.deploy.NamingResourcesgetGlobalNamingResources()
Return the global naming resources.

public java.lang.StringgetInfo()
Return descriptive information about this Server implementation and the corresponding version number, in the format <description>/<version>.

public intgetPort()
Return the port number we listen to for shutdown commands.

public java.lang.StringgetShutdown()
Return the shutdown command string we are waiting for.

public voidinitialize()
Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.

exception
LifecycleException If this server was already initialized.

public voidremoveService(Service service)
Remove the specified Service from the set associated from this Server.

param
service The Service to be removed

public voidsetGlobalNamingResources(org.apache.catalina.deploy.NamingResources globalNamingResources)
Set the global naming resources.

param
globalNamingResources The new global naming resources

public voidsetPort(int port)
Set the port number we listen to for shutdown commands.

param
port The new port number

public voidsetShutdown(java.lang.String shutdown)
Set the shutdown command we are waiting for.

param
shutdown The new shutdown command