Server (Catalina Internal API Documentation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Server represents one convenient way to package a set of
Connectors
associated with a particular Container
.
You can have several many-to-one relationships (set of Connectors associated
with one Container) by adding one or more Connectors first, followed by the
corresponding Container, and then repeating this pattern.
This interface (and the corresonding implementation) exist to simplify
configuring Catalina from a server.xml
file. It has no
functional role once the server has been started.
Normally, an implementation of this interface will also implement
Lifecycle
, such that when the start()
and
stop()
methods are called, all of the defined Containers
and Connectors 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.
NOTE - The concrete implementation of this class should
register the (singleton) instance with the ServerFactory
class in its constructor(s).
Method Summary | |
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[] |
findServices()
Return the set of Services defined within this Server. |
java.lang.String |
getInfo()
Return descriptive information about this Server implementation and the corresponding version number, in the format <description>/<version> . |
int |
getPort()
Return the port number we listen to for shutdown commands. |
java.lang.String |
getShutdown()
Return the shutdown command string we are waiting for. |
void |
initialize()
Invoke a pre-startup initialization. |
void |
removeService(Service service)
Remove the specified Service from the set associated from this Server. |
void |
setPort(int port)
Set the port number we listen to for shutdown commands. |
void |
setShutdown(java.lang.String shutdown)
Set the shutdown command we are waiting for. |
Method Detail |
public java.lang.String getInfo()
<description>/<version>
.
public int getPort()
public void setPort(int port)
port
- The new port numberpublic java.lang.String getShutdown()
public void setShutdown(java.lang.String shutdown)
shutdown
- The new shutdown commandpublic void addService(Service service)
service
- The Service to be addedpublic void await()
public Service[] findServices()
public void removeService(Service service)
service
- The Service to be removedpublic void initialize() throws LifecycleException
LifecycleException
- If this server was already initialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |