public class StandardService extends LifecycleMBeanBase implements Service
Service
interface. The
associated Container is generally an instance of Engine, but this is
not required.Lifecycle.SingleUse
Modifier and Type | Field and Description |
---|---|
protected Connector[] |
connectors
The set of Connectors associated with this Service.
|
protected Container |
container
Deprecated.
Will be made private in 8.5.x
|
protected java.util.ArrayList<Executor> |
executors |
protected Mapper |
mapper
Mapper.
|
protected MapperListener |
mapperListener
Mapper listener.
|
protected java.beans.PropertyChangeSupport |
support
The property change support for this component.
|
mserver
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
StandardService() |
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 |
addExecutor(Executor ex)
Adds a named executor to the service
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component.
|
protected void |
destroyInternal()
Sub-classes wishing to perform additional clean-up should override this
method, ensuring that super.destroyInternal() is the last call in the
overriding method.
|
Connector[] |
findConnectors()
Find and return the set of Connectors associated with this Service.
|
Executor[] |
findExecutors()
Retrieves all executors
|
javax.management.ObjectName[] |
getConnectorNames() |
Container |
getContainer()
Return the
Container that handles requests for all
Connectors associated with this Service. |
protected java.lang.String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans
should be registered.
|
Executor |
getExecutor(java.lang.String executorName)
Retrieves executor by name, null if not found
|
Mapper |
getMapper() |
java.lang.String |
getName()
Return the name of this Service.
|
java.lang.String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
java.lang.ClassLoader |
getParentClassLoader()
Return the parent class loader for this component.
|
Server |
getServer()
Return the
Server with which we are associated (if any). |
protected void |
initInternal()
Invoke a pre-startup initialization.
|
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 |
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 |
setContainer(Engine engine)
Set the
Engine that handles requests for all
Connectors associated with this Service. |
void |
setName(java.lang.String name)
Set the name of this Service.
|
void |
setParentClassLoader(java.lang.ClassLoader parent)
Set the parent class loader for this server.
|
void |
setServer(Server server)
Set the
Server with which we are associated (if any). |
protected void |
startInternal()
Start nested components (
Executor s, Connector s and
Container s) and implement the requirements of
LifecycleBase.startInternal() . |
protected void |
stopInternal()
Stop nested components (
Executor s, Connector s and
Container s) and implement the requirements of
LifecycleBase.stopInternal() . |
java.lang.String |
toString()
Return a String representation of this component.
|
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
protected final java.beans.PropertyChangeSupport support
protected Connector[] connectors
protected final java.util.ArrayList<Executor> executors
@Deprecated protected Container container
protected final Mapper mapper
protected final MapperListener mapperListener
public Mapper getMapper()
public Container getContainer()
Container
that handles requests for all
Connectors
associated with this Service.getContainer
in interface Service
Container
that handles requests for all
Connectors
associated with this Service.public void setContainer(Container container)
Service
Container
that handles requests for all
Connectors
associated with this Service.setContainer
in interface Service
container
- The new Containerpublic void setContainer(Engine engine)
Service
Engine
that handles requests for all
Connectors
associated with this Service.setContainer
in interface Service
engine
- The new Enginepublic java.lang.String getName()
public void setName(java.lang.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 void addConnector(Connector connector)
addConnector
in interface Service
connector
- The Connector to be addedpublic javax.management.ObjectName[] getConnectorNames()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to addpublic Connector[] findConnectors()
findConnectors
in interface Service
public void removeConnector(Connector connector)
removeConnector
in interface Service
connector
- The Connector to be removedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to removepublic java.lang.String toString()
toString
in class java.lang.Object
public void addExecutor(Executor ex)
addExecutor
in interface Service
ex
- Executorpublic Executor[] findExecutors()
findExecutors
in interface Service
public Executor getExecutor(java.lang.String executorName)
getExecutor
in interface Service
executorName
- Stringpublic void removeExecutor(Executor ex)
removeExecutor
in interface Service
ex
- Executorprotected void startInternal() throws LifecycleException
Executor
s, Connector
s and
Container
s) and implement the requirements of
LifecycleBase.startInternal()
.startInternal
in class LifecycleBase
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedprotected void stopInternal() throws LifecycleException
Executor
s, Connector
s and
Container
s) and implement the requirements of
LifecycleBase.stopInternal()
.stopInternal
in class LifecycleBase
LifecycleException
- if this component detects a fatal error
that needs to be reportedprotected void initInternal() throws LifecycleException
initInternal
in class LifecycleMBeanBase
LifecycleException
protected void destroyInternal() throws LifecycleException
LifecycleMBeanBase
destroyInternal
in class LifecycleMBeanBase
LifecycleException
public java.lang.ClassLoader getParentClassLoader()
getParentClassLoader
in interface Service
Service.getServer()
Server.getParentClassLoader()
. If no server
has been set, return the system class loader.public void setParentClassLoader(java.lang.ClassLoader parent)
setParentClassLoader
in interface Service
parent
- The new parent class loaderprotected java.lang.String getDomainInternal()
LifecycleMBeanBase
getDomainInternal
in class LifecycleMBeanBase
public final java.lang.String getObjectNameKeyProperties()
LifecycleMBeanBase
ObjectName
that will be used to register this component.getObjectNameKeyProperties
in class LifecycleMBeanBase
ObjectName
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.