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[] | connectorsThe set of Connectors associated with this Service. | 
| protected Container | containerThe Container associated with this Service. | 
| protected ArrayList<Executor> | executors | 
| protected PropertyChangeSupport | supportThe property change support for this component. | 
mserverAFTER_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(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 | 
| ObjectName[] | getConnectorNames() | 
| Container | getContainer()Return the  Containerthat handles requests for allConnectorsassociated with this Service. | 
| protected String | getDomainInternal()Method implemented by sub-classes to identify the domain in which MBeans
 should be registered. | 
| Executor | getExecutor(String executorName)Retrieves executor by name, null if not found | 
| 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. | 
| String | getObjectNameKeyProperties()Allow sub-classes to specify the key properties component of the
  ObjectNamethat will be used to register this component. | 
| ClassLoader | getParentClassLoader()Return the parent class loader for this component. | 
| Server | getServer()Return the  Serverwith 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(PropertyChangeListener listener)Remove a property change listener from this component. | 
| void | setContainer(Container container)Set the  Containerthat handles requests for allConnectorsassociated with this Service. | 
| void | setName(String name)Set the name of this Service. | 
| void | setParentClassLoader(ClassLoader parent)Set the parent class loader for this server. | 
| void | setServer(Server server)Set the  Serverwith which we are associated (if any). | 
| protected void | startInternal()Start nested components ( Executors,Connectors andContainers) and implement the requirements ofLifecycleBase.startInternal(). | 
| protected void | stopInternal()Stop nested components ( Executors,Connectors andContainers) and implement the requirements ofLifecycleBase.stopInternal(). | 
| String | toString()Return a String representation of this component. | 
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stopprotected PropertyChangeSupport support
protected Connector[] connectors
protected Container container
public Container getContainer()
Container that handles requests for all
 Connectors associated with this Service.getContainer in interface ServiceContainer that handles requests for all
 Connectors associated with this Service.public void setContainer(Container container)
Container that handles requests for all
 Connectors associated with this Service.setContainer in interface Servicecontainer - The new Containerpublic 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 void addConnector(Connector connector)
addConnector in interface Serviceconnector - The Connector to be addedpublic ObjectName[] getConnectorNames()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener - The listener to addpublic Connector[] findConnectors()
findConnectors in interface Servicepublic void removeConnector(Connector connector)
removeConnector in interface Serviceconnector - The Connector to be removedpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener - The listener to removepublic String toString()
public void addExecutor(Executor ex)
addExecutor in interface Serviceex - Executorpublic Executor[] findExecutors()
findExecutors in interface Servicepublic Executor getExecutor(String executorName)
getExecutor in interface ServiceexecutorName - Stringpublic void removeExecutor(Executor ex)
removeExecutor in interface Serviceex - Executorprotected void startInternal()
                      throws LifecycleException
Executors, Connectors and
 Containers) and implement the requirements of
 LifecycleBase.startInternal().startInternal in class LifecycleBaseLifecycleException - if this component detects a fatal error
  that prevents this component from being usedprotected void stopInternal()
                     throws LifecycleException
Executors, Connectors and
 Containers) and implement the requirements of
 LifecycleBase.stopInternal().stopInternal in class LifecycleBaseLifecycleException - if this component detects a fatal error
  that needs to be reportedprotected void initInternal()
                     throws LifecycleException
initInternal in class LifecycleMBeanBaseLifecycleException - If the initialisation failsprotected void destroyInternal()
                        throws LifecycleException
LifecycleMBeanBasedestroyInternal in class LifecycleMBeanBaseLifecycleException - If the destruction failspublic ClassLoader getParentClassLoader()
getParentClassLoader in interface ServiceService.getServer() Server.getParentClassLoader(). If no server
 has been set, return the system class loader.public void setParentClassLoader(ClassLoader parent)
setParentClassLoader in interface Serviceparent - The new parent class loaderprotected String getDomainInternal()
LifecycleMBeanBasegetDomainInternal in class LifecycleMBeanBasepublic final String getObjectNameKeyProperties()
LifecycleMBeanBaseObjectName that will be used to register this component.getObjectNameKeyProperties in class LifecycleMBeanBaseObjectNameCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.