public interface Service extends Lifecycle
A given JVM can contain any number of Service instances; however, they are completely independent of each other and share only the basic JVM facilities and classes on the system class path.
Lifecycle.SingleUse
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
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
|
Connector[] |
findConnectors()
Find and return the set of Connectors associated with this Service.
|
Executor[] |
findExecutors()
Retrieves all executors
|
Container |
getContainer()
Deprecated.
Return value will be narrowed to Engine in Tomcat 9.
|
java.lang.String |
getDomain() |
Executor |
getExecutor(java.lang.String name)
Retrieves executor by name, null if not found
|
Mapper |
getMapper() |
java.lang.String |
getName() |
java.lang.ClassLoader |
getParentClassLoader() |
Server |
getServer() |
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 |
setContainer(Container container)
Deprecated.
Use
setContainer(Engine) Will be removed in Tomcat
9. |
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 service.
|
void |
setServer(Server server)
Set the
Server with which we are associated (if any). |
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
@Deprecated Container getContainer()
Container
that handles requests for all
Connectors
associated with this Service.@Deprecated void setContainer(Container container)
setContainer(Engine)
Will be removed in Tomcat
9.Container
that handles requests for all
Connectors
associated with this Service.container
- The new Containervoid setContainer(Engine engine)
Engine
that handles requests for all
Connectors
associated with this Service.engine
- The new Enginejava.lang.String getName()
void setName(java.lang.String name)
name
- The new service nameServer getServer()
Server
with which we are associated (if any).void setServer(Server server)
Server
with which we are associated (if any).server
- The server that owns this Servicejava.lang.ClassLoader getParentClassLoader()
getServer()
Server.getParentClassLoader()
. If no server
has been set, return the system class loader.void setParentClassLoader(java.lang.ClassLoader parent)
parent
- The new parent class loaderjava.lang.String getDomain()
void addConnector(Connector connector)
connector
- The Connector to be addedConnector[] findConnectors()
void removeConnector(Connector connector)
connector
- The Connector to be removedvoid addExecutor(Executor ex)
ex
- ExecutorExecutor[] findExecutors()
Executor getExecutor(java.lang.String name)
name
- Stringvoid removeExecutor(Executor ex)
ex
- ExecutorMapper getMapper()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.