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[]
connectors
The set of Connectors associated with this Service.protected Object
connectorsMonitor
protected Container
container
The Container associated with this Service.protected int
debug
The debugging detail level for this component.protected String
domain
protected boolean
initialized
Has this component been initialized?protected ObjectName
oname
protected PropertyChangeSupport
support
The 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 void
addConnector(Connector connector)
Add a new Connector to the set of defined Connectors, and associate it with this Service's Container.void
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.void
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.void
destroy()
Connector
findConnector(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.NotificationBroadcasterSupport
getBroadcaster()
Return theNotificationBroadcasterSupport
that sends notification for this Service.ObjectName[]
getConnectorNames()
Container
getContainer()
Return theContainer
that handles requests for allConnectors
associated with this Service.ObjectName
getContainerName()
int
getDebug()
Return the debugging detail level of this component.String
getDomain()
String
getInfo()
Return descriptive information about this Service implementation and the corresponding version number, in the format<description>/<version>
.String
getName()
Return the name of this Service.ObjectName
getObjectName()
Server
getServer()
Return theServer
with which we are associated (if any).void
init()
void
initialize()
Invoke a pre-startup initialization.void
removeConnector(Connector connector)
Remove the specified Connector from the set associated from this Service.void
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.void
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.void
setBroadcaster(NotificationBroadcasterSupport broadcaster)
Set theNotificationBroadcasterSupport
that sends notification for this Servicevoid
setContainer(Container container)
Set theContainer
that handles requests for allConnectors
associated with this Service.void
setDebug(int debug)
Set the debugging detail level of this component.void
setName(String name)
Set the name of this Service.void
setServer(Server server)
Set theServer
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.String
toString()
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 theContainer
that handles requests for allConnectors
associated with this Service.- Specified by:
getContainer
in interfaceService
-
setContainer
public void setContainer(Container container)
Set theContainer
that handles requests for allConnectors
associated with this Service.- Specified by:
setContainer
in 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 theServer
with which we are associated (if any).
-
setServer
public void setServer(Server server)
Set theServer
with which we are associated (if any).
-
getBroadcaster
public NotificationBroadcasterSupport getBroadcaster()
Return theNotificationBroadcasterSupport
that sends notification for this Service.- Specified by:
getBroadcaster
in interfaceService
-
setBroadcaster
public void setBroadcaster(NotificationBroadcasterSupport broadcaster)
Set theNotificationBroadcasterSupport
that sends notification for this Service- Specified by:
setBroadcaster
in 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:
addConnector
in 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:
findConnectors
in 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:
removeConnector
in 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:
addLifecycleListener
in 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:
findLifecycleListeners
in interfaceLifecycle
-
removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.- Specified by:
removeLifecycleListener
in interfaceLifecycle
- 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 interfaceLifecycle
- 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 interfaceLifecycle
- 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 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()
-
-