Package org.apache.catalina.core
Class StandardService
- java.lang.Object
-
- org.apache.catalina.core.StandardService
-
-
Field Summary
Fields Modifier and Type Field Description protected Connector[]connectorsThe set of Connectors associated with this Service.protected ObjectconnectorsMonitorprotected ContainercontainerThe Container associated with this Service.protected intdebugThe debugging detail level for this component.protected Stringdomainprotected booleaninitializedHas this component been initialized?protected ObjectNameonameprotected PropertyChangeSupportsupportThe property change support for this component.-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description StandardService()Construct a default instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnector(Connector connector)Add a new Connector to the set of defined Connectors, and associate it with this Service's Container.voidaddLifecycleListener(LifecycleListener listener)Add a LifecycleEvent listener to this component.voidaddPropertyChangeListener(PropertyChangeListener listener)Add a property change listener to this component.voiddestroy()ConnectorfindConnector(String name)Find and return the Connector associated with this Service and Connector name.Connector[]findConnectors()Find and return the set of Connectors associated with this Service.List<LifecycleListener>findLifecycleListeners()Gets the (possibly empty) list of lifecycle listeners associated with this StandardService.NotificationBroadcasterSupportgetBroadcaster()Return theNotificationBroadcasterSupportthat sends notification for this Service.ObjectName[]getConnectorNames()ContainergetContainer()Return theContainerthat handles requests for allConnectorsassociated with this Service.ObjectNamegetContainerName()intgetDebug()Return the debugging detail level of this component.StringgetDomain()StringgetInfo()Return descriptive information about this Service implementation and the corresponding version number, in the format<description>/<version>.StringgetName()Return the name of this Service.ObjectNamegetObjectName()ServergetServer()Return theServerwith which we are associated (if any).voidinit()voidinitialize()Invoke a pre-startup initialization.voidremoveConnector(Connector connector)Remove the specified Connector from the set associated from this Service.voidremoveLifecycleListener(LifecycleListener listener)Remove a LifecycleEvent listener from this component.voidremovePropertyChangeListener(PropertyChangeListener listener)Remove a property change listener from this component.voidsetBroadcaster(NotificationBroadcasterSupport broadcaster)Set theNotificationBroadcasterSupportthat sends notification for this ServicevoidsetContainer(Container container)Set theContainerthat handles requests for allConnectorsassociated with this Service.voidsetDebug(int debug)Set the debugging detail level of this component.voidsetName(String name)Set the name of this Service.voidsetServer(Server server)Set theServerwith which we are associated (if any).voidstart()Prepare for the beginning of active use of the public methods of this component.voidstop()Gracefully terminate the active use of the public methods of this component.StringtoString()Return a String representation of this component.
-
-
-
Field Detail
-
debug
protected int debug
The debugging detail level for this component.
-
support
protected PropertyChangeSupport support
The property change support for this component.
-
connectors
protected Connector[] connectors
The set of Connectors associated with this Service.
-
connectorsMonitor
protected final Object connectorsMonitor
-
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?
-
domain
protected String domain
-
oname
protected ObjectName oname
-
-
Method Detail
-
getContainer
public Container getContainer()
Return theContainerthat handles requests for allConnectorsassociated with this Service.- Specified by:
getContainerin interfaceService
-
setContainer
public void setContainer(Container container)
Set theContainerthat handles requests for allConnectorsassociated with this Service.- Specified by:
setContainerin interfaceService- Parameters:
container- The new Container
-
getContainerName
public ObjectName getContainerName()
-
getDebug
public int getDebug()
Return the debugging detail level of this component.
-
setDebug
public void setDebug(int debug)
Set the debugging detail level of this component.- Parameters:
debug- The new debugging detail level
-
getInfo
public String getInfo()
Return descriptive information about this Service implementation and the corresponding version number, in the format<description>/<version>.
-
getName
public String getName()
Return the name of this Service.
-
setName
public void setName(String name)
Set the name of this Service.
-
getServer
public Server getServer()
Return theServerwith which we are associated (if any).
-
setServer
public void setServer(Server server)
Set theServerwith which we are associated (if any).
-
getBroadcaster
public NotificationBroadcasterSupport getBroadcaster()
Return theNotificationBroadcasterSupportthat sends notification for this Service.- Specified by:
getBroadcasterin interfaceService
-
setBroadcaster
public void setBroadcaster(NotificationBroadcasterSupport broadcaster)
Set theNotificationBroadcasterSupportthat sends notification for this Service- Specified by:
setBroadcasterin interfaceService- Parameters:
broadcaster- The new NotificationBroadcasterSupport
-
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:
addConnectorin interfaceService- Parameters:
connector- The Connector to be added
-
getConnectorNames
public ObjectName[] getConnectorNames()
-
addPropertyChangeListener
public void addPropertyChangeListener(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:
findConnectorsin interfaceService
-
findConnector
public Connector findConnector(String name)
Find and return the Connector associated with this Service and Connector name.
-
removeConnector
public void removeConnector(Connector connector) throws LifecycleException
Remove the specified Connector from the set associated from this Service. The removed Connector will also be disassociated from our Container.- Specified by:
removeConnectorin interfaceService- Parameters:
connector- The Connector to be removed- Throws:
LifecycleException
-
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.
-
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.- Specified by:
addLifecycleListenerin interfaceLifecycle- Parameters:
listener- The listener to add
-
findLifecycleListeners
public List<LifecycleListener> findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated with this StandardService.- Specified by:
findLifecycleListenersin interfaceLifecycle
-
removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.- Specified by:
removeLifecycleListenerin interfaceLifecycle- Parameters:
listener- The listener to remove
-
start
public void start() throws LifecycleExceptionPrepare 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:
startin interfaceLifecycle- Throws:
LifecycleException- if this component detects a fatal error that prevents this component from being used
-
stop
public void stop() throws LifecycleExceptionGracefully 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:
stopin interfaceLifecycle- Throws:
LifecycleException- if this component detects a fatal error that needs to be reported
-
initialize
public void initialize() throws LifecycleExceptionInvoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.- Specified by:
initializein interfaceService- Throws:
LifecycleException- If this server was already initialized.
-
destroy
public void destroy() throws LifecycleException- Throws:
LifecycleException
-
init
public void init()
-
getObjectName
public ObjectName getObjectName()
-
getDomain
public String getDomain()
-
-