Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » [javadoc | source]
org.apache.catalina
public interface: Server [javadoc | source]

All Known Implementing Classes:
    StandardServer

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

Method from org.apache.catalina.Server Summary:
addService,   await,   findService,   findServices,   getGlobalNamingResources,   getInfo,   getPort,   getShutdown,   initialize,   removeService,   setGlobalNamingResources,   setPort,   setShutdown
Method from org.apache.catalina.Server Detail:
 public  void addService(Service service)
    Add a new Service to the set of defined Services.
 public  void await()
    Wait until a proper shutdown command is received, then return.
 public Service findService(String name)
    Return the specified Service (if it exists); otherwise return null.
 public Service[] findServices()
    Return the set of Services defined within this Server.
 public NamingResources getGlobalNamingResources()
    Return the global naming resources.
 public String getInfo()
    Return descriptive information about this Server implementation and the corresponding version number, in the format <description>/<version>.
 public int getPort()
    Return the port number we listen to for shutdown commands.
 public String getShutdown()
    Return the shutdown command string we are waiting for.
 public  void initialize() throws LifecycleException
    Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.
 public  void removeService(Service service)
    Remove the specified Service from the set associated from this Server.
 public  void setGlobalNamingResources(NamingResources globalNamingResources)
    Set the global naming resources.
 public  void setPort(int port)
    Set the port number we listen to for shutdown commands.
 public  void setShutdown(String shutdown)
    Set the shutdown command we are waiting for.