Class StandardServer

  • All Implemented Interfaces:
    Lifecycle, Server

    public final class StandardServer
    extends Object
    implements Lifecycle, Server
    Standard implementation of the Server interface, available for use (but not required) when deploying and starting Catalina.
    Version:
    $Revision: 1.5 $ $Date: 2007/02/20 20:16:56 $
    Author:
    Craig R. McClanahan
    • Constructor Detail

      • StandardServer

        public StandardServer()
        Construct a default instance of this class.
    • Method Detail

      • getDebug

        public int getDebug()
        Return the debugging detail level.
      • setDebug

        public void setDebug​(int debug)
        Set the debugging detail level.
        Parameters:
        debug - The new debugging detail level
      • getGlobalNamingContext

        public Context getGlobalNamingContext()
        Return the global naming resources context.
      • setGlobalNamingContext

        public void setGlobalNamingContext​(Context globalNamingContext)
        Set the global naming resources context.
        Parameters:
        globalNamingContext - The new global naming resource context
      • 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
      • 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
      • 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
      • 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
      • await

        public void await()
        Wait until a proper shutdown command is received, then return.
        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()
        Returns:
        the object names of all registered Service instances
      • 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
      • addLifecycleListener

        public void addLifecycleListener​(LifecycleListener listener)
        Add a LifecycleEvent listener to this component.
        Specified by:
        addLifecycleListener in interface Lifecycle
        Parameters:
        listener - The listener to add
      • removeLifecycleListener

        public void removeLifecycleListener​(LifecycleListener listener)
        Remove a LifecycleEvent listener from this component.
        Specified by:
        removeLifecycleListener in interface Lifecycle
        Parameters:
        listener - The listener to remove
      • start

        public void start()
                   throws LifecycleException
        Prepare for the beginning of active use of the public methods of this component. This method should be called before any of the public methods of this component are utilized. It should also send a LifecycleEvent of type START_EVENT to any registered listeners.
        Specified by:
        start in interface Lifecycle
        Throws:
        LifecycleException - if this component detects a fatal error that prevents this component from being used
      • stop

        public void stop()
                  throws LifecycleException
        Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component. It should also send a LifecycleEvent of type STOP_EVENT to any registered listeners.
        Specified by:
        stop in interface Lifecycle
        Throws:
        LifecycleException - if this component detects a fatal error that needs to be reported
      • initialize

        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.
        Specified by:
        initialize in interface Server
        Throws:
        LifecycleException - If this server was already initialized.
      • getObjectName

        public ObjectName getObjectName()
      • getDomain

        public String getDomain()