Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 package org.apache.catalina;

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

Craig R. McClanahan
$Revision: 1433 $ $Date: 2010-04-09 00:33:40 +0200 (Fri, 09 Apr 2010) $
 public interface Server {
     // ------------------------------------------------------------- Properties

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

Add a new Service to the set of defined Services.

service The Service to be added
     public void addService(Service service);

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

name Name of the Service to be returned
     public Service findService(String name);

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

Remove the specified Service from the set associated from this Server.

service The Service to be removed
     public void removeService(Service service);

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

LifecycleException If this server was already initialized.
    public void initialize()
    throws LifecycleException;
New to GrepCode? Check out our FAQ X