Modifier and Type | Field and 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.
|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
StandardService()
Construct a default instance of this class.
|
Modifier and Type | Method and 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 the
NotificationBroadcasterSupport that sends notification for this Service. |
ObjectName[] |
getConnectorNames() |
Container |
getContainer()
Return the
Container that handles requests for all
Connectors 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 the
Server 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 the
NotificationBroadcasterSupport that sends notification for this Service |
void |
setContainer(Container container)
Set the
Container that handles requests for all
Connectors 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 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.
|
String |
toString()
Return a String representation of this component.
|
protected int debug
protected PropertyChangeSupport support
protected Connector[] connectors
protected final Object connectorsMonitor
protected Container container
protected boolean initialized
protected String domain
protected ObjectName oname
public StandardService()
public Container getContainer()
Container
that handles requests for all
Connectors
associated with this Service.getContainer
in interface Service
public void setContainer(Container container)
Container
that handles requests for all
Connectors
associated with this Service.setContainer
in interface Service
container
- The new Containerpublic ObjectName getContainerName()
public int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic String getInfo()
<description>/<version>
.public String getName()
public void setName(String name)
public Server getServer()
Server
with which we are associated (if any).public void setServer(Server server)
Server
with which we are associated (if any).public NotificationBroadcasterSupport getBroadcaster()
NotificationBroadcasterSupport
that sends notification for this Service.getBroadcaster
in interface Service
public void setBroadcaster(NotificationBroadcasterSupport broadcaster)
NotificationBroadcasterSupport
that sends notification for this ServicesetBroadcaster
in interface Service
broadcaster
- The new NotificationBroadcasterSupportpublic void addConnector(Connector connector)
addConnector
in interface Service
connector
- The Connector to be addedpublic ObjectName[] getConnectorNames()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to addpublic Connector[] findConnectors()
findConnectors
in interface Service
public Connector findConnector(String name)
public void removeConnector(Connector connector) throws LifecycleException
removeConnector
in interface Service
connector
- The Connector to be removedLifecycleException
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to removepublic String toString()
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic List<LifecycleListener> findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void start() throws LifecycleException
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void initialize() throws LifecycleException
initialize
in interface Service
LifecycleException
- If this server was already initialized.public void destroy() throws LifecycleException
LifecycleException
public void init()
public ObjectName getObjectName()
public String getDomain()
Copyright © 2021. All rights reserved.