public interface Server extends Lifecycle
Server element represents the entire Catalina
servlet container. Its attributes represent the characteristics of
the servlet container as a whole. A Server may contain
one or more Services, and the top level set of naming
resources.
Normally, an implementation of this interface will also implement
Lifecycle, such that when the start() and
stop() methods are called, all of the defined
Services are also started or stopped.
In between, the implementation must open a server socket on the port number
specified by the port property. When a connection is accepted,
the first line is read and compared with the specified shutdown command.
If the command matches, shutdown of the server is initiated.
Lifecycle.SingleUseAFTER_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 |
addService(Service service)
Add a new Service to the set of defined Services.
|
void |
await()
Wait until a proper shutdown command is received, then return.
|
Service |
findService(String name)
Find the specified Service
|
Service[] |
findServices() |
String |
getAddress() |
Catalina |
getCatalina() |
File |
getCatalinaBase() |
File |
getCatalinaHome() |
Context |
getGlobalNamingContext() |
NamingResourcesImpl |
getGlobalNamingResources() |
Object |
getNamingToken() |
ClassLoader |
getParentClassLoader() |
int |
getPort() |
int |
getPortOffset()
Get the number that offsets the port used for shutdown commands.
|
int |
getPortWithOffset()
Get the actual port on which server is listening for the shutdown commands.
|
String |
getShutdown() |
ScheduledExecutorService |
getUtilityExecutor() |
int |
getUtilityThreads()
Get the utility thread count.
|
void |
removeService(Service service)
Remove the specified Service from the set associated from this
Server.
|
void |
setAddress(String address)
Set the address on which we listen to for shutdown commands.
|
void |
setCatalina(Catalina catalina)
Set the outer Catalina startup/shutdown component if present.
|
void |
setCatalinaBase(File catalinaBase)
Set the configured base (instance) directory.
|
void |
setCatalinaHome(File catalinaHome)
Set the configured home (binary) directory.
|
void |
setGlobalNamingResources(NamingResourcesImpl globalNamingResources)
Set the global naming resources.
|
void |
setParentClassLoader(ClassLoader parent)
Set the parent class loader for this server.
|
void |
setPort(int port)
Set the port number we listen to for shutdown commands.
|
void |
setPortOffset(int portOffset)
Set the number that offsets the server port used for shutdown commands.
|
void |
setShutdown(String shutdown)
Set the shutdown command we are waiting for.
|
void |
setUtilityThreads(int utilityThreads)
Set the utility thread count.
|
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stopNamingResourcesImpl getGlobalNamingResources()
void setGlobalNamingResources(NamingResourcesImpl globalNamingResources)
globalNamingResources - The new global naming resourcesContext getGlobalNamingContext()
int getPort()
getPortOffset(),
getPortWithOffset()void setPort(int port)
port - The new port numbersetPortOffset(int)int getPortOffset()
void setPortOffset(int portOffset)
portOffset - sets the port offsetint getPortWithOffset()
String getAddress()
void setAddress(String address)
address - The new addressString getShutdown()
void setShutdown(String shutdown)
shutdown - The new shutdown commandClassLoader getParentClassLoader()
getCatalina() Catalina.getParentClassLoader(). If
catalina has not been set, return the system class loader.void setParentClassLoader(ClassLoader parent)
parent - The new parent class loaderCatalina getCatalina()
void setCatalina(Catalina catalina)
catalina - the outer Catalina componentFile getCatalinaBase()
getCatalinaHome() will be used.void setCatalinaBase(File catalinaBase)
catalinaBase - the configured base directoryFile getCatalinaHome()
void setCatalinaHome(File catalinaHome)
catalinaHome - the configured home directoryint getUtilityThreads()
void setUtilityThreads(int utilityThreads)
utilityThreads - the new thread countvoid addService(Service service)
service - The Service to be addedvoid await()
Service findService(String name)
name - Name of the Service to be returnednull if none exists.Service[] findServices()
void removeService(Service service)
service - The Service to be removedObject getNamingToken()
ScheduledExecutorService getUtilityExecutor()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.