Apache Tomcat 7.0.39

org.apache.catalina
Interface Server

All Superinterfaces:
Lifecycle
All Known Implementing Classes:
StandardServer

public interface Server
extends Lifecycle

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).

Version:
$Id: Server.java 1200162 2011-11-10 05:37:57Z kkolinko $
Author:
Craig R. McClanahan

Field Summary
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Method Summary
 void addService(Service service)
          Add a new Service to the set of defined Services.
 void await()
          Wait until a proper shutdown command is received, then return.
 Service findService(String name)
          Return the specified Service (if it exists); otherwise return null.
 Service[] findServices()
          Return the set of Services defined within this Server.
 String getAddress()
          Return the address on which we listen to for shutdown commands.
 Catalina getCatalina()
          Return the outer Catalina startup/shutdown component if present.
 Context getGlobalNamingContext()
          Return the global naming resources context.
 NamingResources getGlobalNamingResources()
          Return the global naming resources.
 String getInfo()
          Return descriptive information about this Server implementation and the corresponding version number, in the format <description>/<version>.
 ClassLoader getParentClassLoader()
          Return the parent class loader for this component.
 int getPort()
          Return the port number we listen to for shutdown commands.
 String getShutdown()
          Return the shutdown command string we are waiting for.
 void removeService(Service service)
          Remove the specified Service from the set associated from this Server.
 void setAddress(String address)
          Set the address on which we listen to for shutdown commands.
 void setCatalina(Catalina catalina)
          Set the outer Catalina startup/shutdown component if present.
 void setGlobalNamingResources(NamingResources globalNamingResources)
          Set the global naming resources.
 void setParentClassLoader(ClassLoader parent)
          Set the parent class loader for this server.
 void setPort(int port)
          Set the port number we listen to for shutdown commands.
 void setShutdown(String shutdown)
          Set the shutdown command we are waiting for.
 
Methods inherited from interface org.apache.catalina.Lifecycle
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
 

Method Detail

getInfo

String getInfo()
Return descriptive information about this Server implementation and the corresponding version number, in the format <description>/<version>.


getGlobalNamingResources

NamingResources getGlobalNamingResources()
Return the global naming resources.


setGlobalNamingResources

void setGlobalNamingResources(NamingResources globalNamingResources)
Set the global naming resources.

Parameters:
globalNamingResources - The new global naming resources

getGlobalNamingContext

Context getGlobalNamingContext()
Return the global naming resources context.


getPort

int getPort()
Return the port number we listen to for shutdown commands.


setPort

void setPort(int port)
Set the port number we listen to for shutdown commands.

Parameters:
port - The new port number

getAddress

String getAddress()
Return the address on which we listen to for shutdown commands.


setAddress

void setAddress(String address)
Set the address on which we listen to for shutdown commands.

Parameters:
address - The new address

getShutdown

String getShutdown()
Return the shutdown command string we are waiting for.


setShutdown

void setShutdown(String shutdown)
Set the shutdown command we are waiting for.

Parameters:
shutdown - The new shutdown command

getParentClassLoader

ClassLoader getParentClassLoader()
Return the parent class loader for this component. If not set, return getCatalina() Catalina.getParentClassLoader(). If catalina has not been set, return the system class loader.


setParentClassLoader

void setParentClassLoader(ClassLoader parent)
Set the parent class loader for this server.

Parameters:
parent - The new parent class loader

getCatalina

Catalina getCatalina()
Return the outer Catalina startup/shutdown component if present.


setCatalina

void setCatalina(Catalina catalina)
Set the outer Catalina startup/shutdown component if present.


addService

void addService(Service service)
Add a new Service to the set of defined Services.

Parameters:
service - The Service to be added

await

void await()
Wait until a proper shutdown command is received, then return.


findService

Service findService(String name)
Return the specified Service (if it exists); otherwise return null.

Parameters:
name - Name of the Service to be returned

findServices

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


removeService

void removeService(Service service)
Remove the specified Service from the set associated from this Server.

Parameters:
service - The Service to be removed

Apache Tomcat 7.0.39

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.