Apache Tomcat 7.0.42

## org.apache.catalina.core
Class StandardServer

    java.lang.Object
      org.apache.catalina.util.LifecycleBase
          org.apache.catalina.util.LifecycleMBeanBase
              org.apache.catalina.core.StandardServer

All Implemented Interfaces:
  MBeanRegistration, Lifecycle, Server

    public final class StandardServer

extends LifecycleMBeanBase
implements Server

Standard implementation of the Server interface, available for use (but not required) when deploying and starting Catalina.

Version:
  $Id: StandardServer.java 1305949 2012-03-27 18:41:42Z markt $
Author:
  Craig R. McClanahan

Field Summary
`protected PropertyChangeSupport` `support` The property change support for this component.

Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase
`mserver`

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`

Constructor Summary
`StandardServer()` Construct a default instance of this class.

Method Summary
`void` `addPropertyChangeListener(PropertyChangeListener listener)` Add a property change listener to this component.
`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.
`protected void` `destroyInternal()` Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.
`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.
`protected String` `getDomainInternal()` Obtain the MBean domain for this server.
`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>`.
`protected String` `getObjectNameKeyProperties()` Allow sub-classes to specify the key properties component of the `ObjectName` that will be used to register this component.
`ClassLoader` `getParentClassLoader()` Return the parent class loader for this component.
`int` `getPort()` Return the port number we listen to for shutdown commands.
`String` `getServerInfo()` Report the current Tomcat Server Release number
`ObjectName[]` `getServiceNames()` Return the JMX service names.
`String` `getShutdown()` Return the shutdown command string we are waiting for.
`protected void` `initInternal()` Invoke a pre-startup initialization.
`void` `removePropertyChangeListener(PropertyChangeListener listener)` Remove a property change listener from this component.
`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` `setGlobalNamingContext(Context globalNamingContext)` Set the global naming resources context.
`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.
`protected void` `startInternal()` Start nested components (`Service`s) and implement the requirements of `LifecycleBase.startInternal()`.
`void` `stopAwait()`
`protected void` `stopInternal()` Stop nested components (`Service`s) and implement the requirements of `LifecycleBase.stopInternal()`.
`void` `storeConfig()` Write the configuration information for this entire `Server` out to the server.xml configuration file.
`void` `storeContext(Context context)` Write the configuration information for `Context` out to the specified configuration file.
`String` `toString()` Return a String representation of this component.

Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
`getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister`

Methods inherited from class org.apache.catalina.util.LifecycleBase
`addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.apache.catalina.Lifecycle
`addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop`

Field Detail

### support

    protected PropertyChangeSupport support

  The property change support for this component.

Constructor Detail

### StandardServer

    public StandardServer()

  Construct a default instance of this class.

Method Detail

### getGlobalNamingContext

    public Context getGlobalNamingContext()

  Return the global naming resources context.

  Specified by:
    `getGlobalNamingContext` in interface `Server`

### setGlobalNamingContext

    public void setGlobalNamingContext(Context globalNamingContext)

  Set the global naming resources context.

  Parameters:
    `globalNamingContext` - The new global naming resource context

### getGlobalNamingResources

    public NamingResources getGlobalNamingResources()

  Return the global naming resources.

  Specified by:
    `getGlobalNamingResources` in interface `Server`

### setGlobalNamingResources

    public void setGlobalNamingResources(NamingResources globalNamingResources)

  Set the global naming resources.

  Specified by:
    `setGlobalNamingResources` in interface `Server`
  Parameters:
    `globalNamingResources` - The new global naming resources

### getInfo

    public String getInfo()

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

  Specified by:
    `getInfo` in interface `Server`

### getServerInfo

    public String getServerInfo()

  Report the current Tomcat Server Release number

  Returns:
    Tomcat release identifier

### getPort

    public int getPort()

  Return the port number we listen to for shutdown commands.

  Specified by:
    `getPort` in interface `Server`

### setPort

    public void setPort(int port)

  Set the port number we listen to for shutdown commands.

  Specified by:
    `setPort` in interface `Server`
  Parameters:
    `port` - The new port number

### getAddress

    public String getAddress()

  Return the address on which we listen to for shutdown commands.

  Specified by:
    `getAddress` in interface `Server`

### setAddress

    public void setAddress(String address)

  Set the address on which we listen to for shutdown commands.

  Specified by:
    `setAddress` in interface `Server`
  Parameters:
    `address` - The new address

### getShutdown

    public String getShutdown()

  Return the shutdown command string we are waiting for.

  Specified by:
    `getShutdown` in interface `Server`

### setShutdown

    public void setShutdown(String shutdown)

  Set the shutdown command we are waiting for.

  Specified by:
    `setShutdown` in interface `Server`
  Parameters:
    `shutdown` - The new shutdown command

### getCatalina

    public Catalina getCatalina()

  Return the outer Catalina startup/shutdown component if present.

  Specified by:
    `getCatalina` in interface `Server`

### setCatalina

    public void setCatalina(Catalina catalina)

  Set the outer Catalina startup/shutdown component if present.

  Specified by:
    `setCatalina` in interface `Server`

### addService

    public void addService(Service service)

  Add a new Service to the set of defined Services.

  Specified by:
    `addService` in interface `Server`
  Parameters:
    `service` - The Service to be added

### stopAwait

    public void stopAwait()

### await

    public void await()

  Wait until a proper shutdown command is received, then return. This keeps the main thread alive - the thread pool listening for http connections is daemon threads.

  Specified by:
    `await` in interface `Server`

### findService

    public Service findService(String name)

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

  Specified by:
    `findService` in interface `Server`
  Parameters:
    `name` - Name of the Service to be returned

### findServices

    public Service[] findServices()

  Return the set of Services defined within this Server.

  Specified by:
    `findServices` in interface `Server`

### getServiceNames

    public ObjectName[] getServiceNames()

  Return the JMX service names.

### removeService

    public void removeService(Service service)

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

  Specified by:
    `removeService` in interface `Server`
  Parameters:
    `service` - The Service to be removed

### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener listener)

  Add a property change listener to this component.

  Parameters:
    `listener` - The listener to add

### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener listener)

  Remove a property change listener from this component.

  Parameters:
    `listener` - The listener to remove

### toString

    public String toString()

  Return a String representation of this component.

  Overrides:
    `toString` in class `Object`

### storeConfig

    public void storeConfig()
                     throws Exception

  Write the configuration information for this entire `Server` out to the server.xml configuration file.

  Throws:
    `InstanceNotFoundException` - if the managed resource object cannot be found
    `MBeanException` - if the initializer of the object throws an exception, or persistence is not supported
    `RuntimeOperationsException` - if an exception is reported by the persistence mechanism
    `Exception`

### storeContext

    public void storeContext(Context context)
                      throws Exception

  Write the configuration information for `Context` out to the specified configuration file.

  Throws:
    `InstanceNotFoundException` - if the managed resource object cannot be found
    `MBeanException` - if the initializer of the object throws an exception, or persistence is not supported
    `RuntimeOperationsException` - if an exception is reported by the persistence mechanism
    `Exception`

### startInternal

    protected void startInternal()
                          throws LifecycleException

  Start nested components (`Service`s) and implement the requirements of `LifecycleBase.startInternal()`.

  Specified by:
    `startInternal` in class `LifecycleBase`
  Throws:
    `LifecycleException` - if this component detects a fatal error that prevents this component from being used

### stopInternal

    protected void stopInternal()
                         throws LifecycleException

  Stop nested components (`Service`s) and implement the requirements of `LifecycleBase.stopInternal()`.

  Specified by:
    `stopInternal` in class `LifecycleBase`
  Throws:
    `LifecycleException` - if this component detects a fatal error that needs to be reported

### initInternal

    protected void initInternal()
                         throws LifecycleException

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

  Overrides:
    `initInternal` in class `LifecycleMBeanBase`
  Throws:
    `LifecycleException`

### destroyInternal

    protected void destroyInternal()
                            throws LifecycleException

  Description copied from class: `LifecycleMBeanBase`
  Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.

  Overrides:
    `destroyInternal` in class `LifecycleMBeanBase`
  Throws:
    `LifecycleException`

### getParentClassLoader

    public ClassLoader getParentClassLoader()

  Return the parent class loader for this component.

  Specified by:
    `getParentClassLoader` in interface `Server`

### setParentClassLoader

    public void setParentClassLoader(ClassLoader parent)

  Set the parent class loader for this server.

  Specified by:
    `setParentClassLoader` in interface `Server`
  Parameters:
    `parent` - The new parent class loader

### getDomainInternal

    protected String getDomainInternal()

  Obtain the MBean domain for this server. The domain is obtained using the following search order:
  1. Name of first `Engine`.
  2. Name of first `Service`.

  Specified by:
    `getDomainInternal` in class `LifecycleMBeanBase`
  Returns:
    The name of the domain to use to register MBeans.

### getObjectNameKeyProperties

    protected final String getObjectNameKeyProperties()

  Description copied from class: `LifecycleMBeanBase`
  Allow sub-classes to specify the key properties component of the `ObjectName` that will be used to register this component.

  Specified by:
    `getObjectNameKeyProperties` in class `LifecycleMBeanBase`
  Returns:
    The string representation of the key properties component of the desired `ObjectName`

Apache Tomcat 7.0.42

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