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.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public Service | Returns: the specified Service, ornull if none exists.Name of the Service to be returned name)Find the specified Service |
| public Service[] | |
| public String | |
| public Catalina | |
| public File | Returns: the configured base (instance) directory. Note that home and base may be the same (and are by default). If this is not set the value returned bygetCatalinaHome() will be used.
|
| public File | Returns: the configured home (binary) directory. Note that home and base may be the same (and are by default).
|
| public Context | |
| public NamingResourcesImpl | |
| public Object | |
| public ClassLoader | Returns: the parent class loader for this component. If not set, returngetCatalina() Catalina#getParentClassLoader(). If
catalina has not been set, return the system class loader.
|
| public int | |
| public int | Returns: the port offsetGet the number that offsets the port used for shutdown commands. |
| public int | Returns: the port with offsetGet the actual port on which server is listening for the shutdown commands. |
| public String | |
| public ScheduledExecutorService | |
| public int | |
| public void | removeService(Service
The Service to be removed service)Remove the specified Service from the set associated from this Server. |
| public void | setAddress(String
The new address address)Set the address on which we listen to for shutdown commands. |
| public void | setCatalina(Catalina
the outer Catalina component catalina)Set the outer Catalina startup/shutdown component if present. |
| public void | setCatalinaBase(File
the configured base directory catalinaBase)Set the configured base (instance) directory. |
| public void | setCatalinaHome(File
the configured home directory catalinaHome)Set the configured home (binary) directory. |
| public void | setGlobalNamingResources(NamingResourcesImpl
The new global naming resources globalNamingResources)Set the global naming resources. |
| public void | setParentClassLoader(ClassLoader
The new parent class loader parent)Set the parent class loader for this server. |
| public void | |
| public void | setPortOffset(int
sets the port offset portOffset)Set the number that offsets the server port used for shutdown commands. |
| public void | |
| public void |
| addService | back to summary |
|---|---|
| public void addService(Service service) Add a new Service to the set of defined Services.
| |
| await | back to summary |
|---|---|
| public void await() Wait until a proper shutdown command is received, then return. | |
| findService | back to summary |
|---|---|
| public Service findService(String name) Find the specified Service | |
| findServices | back to summary |
|---|---|
public Service[] findServices()
| |
| getAddress | back to summary |
|---|---|
public String getAddress()
| |
| getCatalina | back to summary |
|---|---|
public Catalina getCatalina()
| |
| getCatalinaBase | back to summary |
|---|---|
public File getCatalinaBase()
| |
| getCatalinaHome | back to summary |
|---|---|
public File getCatalinaHome()
| |
| getGlobalNamingContext | back to summary |
|---|---|
public Context getGlobalNamingContext()
| |
| getGlobalNamingResources | back to summary |
|---|---|
public NamingResourcesImpl getGlobalNamingResources()
| |
| getNamingToken | back to summary |
|---|---|
public Object getNamingToken()
| |
| getParentClassLoader | back to summary |
|---|---|
public ClassLoader getParentClassLoader()
| |
| getPort | back to summary |
|---|---|
public int getPort()
| |
| getPortOffset | back to summary |
|---|---|
| public int getPortOffset() Get the number that offsets the port used for shutdown commands. For example, if port is 8005, and portOffset is 1000, the server listens at 9005.
| |
| getPortWithOffset | back to summary |
|---|---|
| public int getPortWithOffset() Get the actual port on which server is listening for the shutdown commands. If you do not set port offset, port is returned. If you set port offset, port offset + port is returned.
| |
| getShutdown | back to summary |
|---|---|
public String getShutdown()
| |
| getUtilityExecutor | back to summary |
|---|---|
public ScheduledExecutorService getUtilityExecutor()
| |
| getUtilityThreads | back to summary |
|---|---|
| public int getUtilityThreads() Get the utility thread count.
| |
| removeService | back to summary |
|---|---|
| public void removeService(Service service) Remove the specified Service from the set associated from this Server.
| |
| setAddress | back to summary |
|---|---|
| public void setAddress(String address) Set the address on which we listen to for shutdown commands.
| |
| setCatalina | back to summary |
|---|---|
| public void setCatalina(Catalina catalina) Set the outer Catalina startup/shutdown component if present.
| |
| setCatalinaBase | back to summary |
|---|---|
| public void setCatalinaBase(File catalinaBase) Set the configured base (instance) directory. Note that home and base may be the same (and are by default).
| |
| setCatalinaHome | back to summary |
|---|---|
| public void setCatalinaHome(File catalinaHome) Set the configured home (binary) directory. Note that home and base may be the same (and are by default).
| |
| setGlobalNamingResources | back to summary |
|---|---|
| public void setGlobalNamingResources(NamingResourcesImpl globalNamingResources) Set the global naming resources.
| |
| setParentClassLoader | back to summary |
|---|---|
| public void setParentClassLoader(ClassLoader parent) Set the parent class loader for this server.
| |
| setPort | back to summary |
|---|---|
| public void setPort(int port) Set the port number we listen to for shutdown commands.
| |
| setPortOffset | back to summary |
|---|---|
| public void setPortOffset(int portOffset) Set the number that offsets the server port used for shutdown commands. For example, if port is 8005, and you set portOffset to 1000, connector listens at 9005.
| |
| setShutdown | back to summary |
|---|---|
| public void setShutdown(String shutdown) Set the shutdown command we are waiting for.
| |
| setUtilityThreads | back to summary |
|---|---|
| public void setUtilityThreads(int utilityThreads) Set the utility thread count.
| |