Apache Tomcat 6.0.53

org.apache.catalina.core
Class StandardService

java.lang.Object
  extended by org.apache.catalina.core.StandardService
All Implemented Interfaces:
javax.management.MBeanRegistration, Lifecycle, Service
Direct Known Subclasses:
Embedded

public class StandardService
extends java.lang.Object
implements Lifecycle, Service, javax.management.MBeanRegistration

Standard implementation of the Service interface. The associated Container is generally an instance of Engine, but this is not required.

Author:
Craig R. McClanahan

Field Summary
protected  Connector[] connectors
          The set of Connectors associated with this Service.
protected  Container container
          The Container associated with this Service.
protected  javax.management.ObjectName controller
           
protected  java.lang.String domain
           
protected  java.util.ArrayList<Executor> executors
           
protected  boolean initialized
          Has this component been initialized?
protected  javax.management.MBeanServer mserver
           
protected  javax.management.ObjectName oname
           
protected  java.lang.String suffix
           
protected  java.beans.PropertyChangeSupport support
          The property change support for this component.
protected  java.lang.String type
           
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
StandardService()
           
 
Method Summary
 void addConnector(Connector connector)
          Add a new Connector to the set of defined Connectors, and associate it with this Service's Container.
 void addExecutor(Executor ex)
          Adds a named executor to the service
 void addLifecycleListener(LifecycleListener listener)
          Add a LifecycleEvent listener to this component.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a property change listener to this component.
 void destroy()
           
 Connector[] findConnectors()
          Find and return the set of Connectors associated with this Service.
 Executor[] findExecutors()
          Retrieves all executors
 LifecycleListener[] findLifecycleListeners()
          Get the lifecycle listeners associated with this lifecycle.
 javax.management.ObjectName[] getConnectorNames()
           
 Container getContainer()
          Return the Container that handles requests for all Connectors associated with this Service.
 javax.management.ObjectName getContainerName()
           
 java.lang.String getDomain()
           
 Executor getExecutor(java.lang.String name)
          Retrieves executor by name, null if not found
 java.lang.String getInfo()
          Return descriptive information about this Service implementation and the corresponding version number, in the format <description>/<version>.
 java.lang.String getName()
          Return the name of this Service.
 javax.management.ObjectName getObjectName()
           
 Server getServer()
          Return the Server with which we are associated (if any).
 void init()
           
 void initialize()
          Invoke a pre-startup initialization.
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void removeConnector(Connector connector)
          Remove the specified Connector from the set associated from this Service.
 void removeExecutor(Executor ex)
          Removes an executor from the service
 void removeLifecycleListener(LifecycleListener listener)
          Remove a LifecycleEvent listener from this component.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a property change listener from this component.
 void setContainer(Container container)
          Set the Container that handles requests for all Connectors associated with this Service.
 void setName(java.lang.String name)
          Set the name of this Service.
 void setServer(Server server)
          Set the Server with which we are associated (if any).
 void start()
          Prepare for the beginning of active use of the public methods of this component.
 void stop()
          Gracefully terminate the active use of the public methods of this component.
 java.lang.String toString()
          Return a String representation of this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

support

protected java.beans.PropertyChangeSupport support
The property change support for this component.


connectors

protected Connector[] connectors
The set of Connectors associated with this Service.


executors

protected java.util.ArrayList<Executor> executors

container

protected Container container
The Container associated with this Service. (In the case of the org.apache.catalina.startup.Embedded subclass, this holds the most recently added Engine.)


initialized

protected boolean initialized
Has this component been initialized?


type

protected java.lang.String type

domain

protected java.lang.String domain

suffix

protected java.lang.String suffix

oname

protected javax.management.ObjectName oname

controller

protected javax.management.ObjectName controller

mserver

protected javax.management.MBeanServer mserver
Constructor Detail

StandardService

public StandardService()
Method Detail

getContainer

public Container getContainer()
Return the Container that handles requests for all Connectors associated with this Service.

Specified by:
getContainer in interface Service

setContainer

public void setContainer(Container container)
Set the Container that handles requests for all Connectors associated with this Service.

Specified by:
setContainer in interface Service
Parameters:
container - The new Container

getContainerName

public javax.management.ObjectName getContainerName()

getInfo

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

Specified by:
getInfo in interface Service

getName

public java.lang.String getName()
Return the name of this Service.

Specified by:
getName in interface Service

setName

public void setName(java.lang.String name)
Set the name of this Service.

Specified by:
setName in interface Service
Parameters:
name - The new service name

getServer

public Server getServer()
Return the Server with which we are associated (if any).

Specified by:
getServer in interface Service

setServer

public void setServer(Server server)
Set the Server with which we are associated (if any).

Specified by:
setServer in interface Service
Parameters:
server - The server that owns this Service

addConnector

public void addConnector(Connector connector)
Add a new Connector to the set of defined Connectors, and associate it with this Service's Container.

Specified by:
addConnector in interface Service
Parameters:
connector - The Connector to be added

getConnectorNames

public javax.management.ObjectName[] getConnectorNames()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.

Parameters:
listener - The listener to add

findConnectors

public Connector[] findConnectors()
Find and return the set of Connectors associated with this Service.

Specified by:
findConnectors in interface Service

removeConnector

public void removeConnector(Connector connector)
Remove the specified Connector from the set associated from this Service. The removed Connector will also be disassociated from our Container.

Specified by:
removeConnector in interface Service
Parameters:
connector - The Connector to be removed

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component.

Parameters:
listener - The listener to remove

toString

public java.lang.String toString()
Return a String representation of this component.

Overrides:
toString in class java.lang.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

findLifecycleListeners

public LifecycleListener[] findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.

Specified by:
findLifecycleListeners in interface Lifecycle

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

addExecutor

public void addExecutor(Executor ex)
Adds a named executor to the service

Specified by:
addExecutor in interface Service
Parameters:
ex - Executor

findExecutors

public Executor[] findExecutors()
Retrieves all executors

Specified by:
findExecutors in interface Service
Returns:
Executor[]

getExecutor

public Executor getExecutor(java.lang.String name)
Retrieves executor by name, null if not found

Specified by:
getExecutor in interface Service
Parameters:
name - String
Returns:
Executor

removeExecutor

public void removeExecutor(Executor ex)
Removes an executor from the service

Specified by:
removeExecutor in interface Service
Parameters:
ex - Executor

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 Service
Throws:
LifecycleException - If this server was already initialized.

destroy

public void destroy()
             throws LifecycleException
Throws:
LifecycleException

init

public void init()

getObjectName

public javax.management.ObjectName getObjectName()

getDomain

public java.lang.String getDomain()

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

Apache Tomcat 6.0.53

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