| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Context. | SERVER_CONTEXT_KEY
Key for accessing the |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | Returns: whether the server is terminated, as would be done byisTerminated().Waits for the server to become terminated, giving up if the timeout is reached. |
| public abstract void | |
| public List | getImmutableServices()
Returns immutable services registered with the server, or an empty list if not supported by the implementation. |
| public List | |
| public List | getMutableServices()
Returns mutable services registered with the server, or an empty list if not supported by the implementation. |
| public int | |
| public List | getServices()
Returns all services registered with the server, or an empty list if not supported by the implementation. |
| public abstract boolean | |
| public abstract boolean | |
| public abstract Server | Returns: this objectInitiates an orderly shutdown in which preexisting calls continue but new calls are rejected. |
| public abstract Server | Returns: this objectInitiates a forceful shutdown in which preexisting and new calls are rejected. |
| public abstract Server |
| SERVER_CONTEXT_KEY | back to summary |
|---|---|
| pack-priv static final Context. Key for accessing the | |
| Server | back to summary |
|---|---|
| public Server() | |
| awaitTermination | back to summary |
|---|---|
| public abstract boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException Waits for the server to become terminated, giving up if the timeout is reached. Calling this method before
| |
| awaitTermination | back to summary |
|---|---|
| public abstract void awaitTermination() throws InterruptedException Waits for the server to become terminated. Calling this method before
| |
| getImmutableServices | back to summary |
|---|---|
| public List Returns immutable services registered with the server, or an empty list if not supported by the implementation.
| |
| getListenSockets | back to summary |
|---|---|
| public List Returns a list of listening sockets for this server. May be different than the originally requested sockets (e.g. listening on port '0' may end up listening on a different port). The list is unmodifiable.
| |
| getMutableServices | back to summary |
|---|---|
| public List Returns mutable services registered with the server, or an empty list if not supported by the implementation.
| |
| getPort | back to summary |
|---|---|
| public int getPort() Returns the port number the server is listening on. This can return -1 if there is no actual port or the result otherwise does not make sense. Result is undefined after the server is terminated. If there are multiple possible ports, this will return one arbitrarily. Implementations are encouraged to return the same port on each call.
| |
| getServices | back to summary |
|---|---|
| public List Returns all services registered with the server, or an empty list if not supported by the implementation.
| |
| isShutdown | back to summary |
|---|---|
| public abstract boolean isShutdown() Returns whether the server is shutdown. Shutdown servers reject any new calls, but may still have some calls being processed.
| |
| isTerminated | back to summary |
|---|---|
| public abstract boolean isTerminated() Returns whether the server is terminated. Terminated servers have no running calls and relevant resources released (like TCP connections).
| |
| shutdown | back to summary |
|---|---|
| public abstract Server shutdown() Initiates an orderly shutdown in which preexisting calls continue but new calls are rejected. After this call returns, this server has released the listening socket(s) and may be reused by another server. Note that this method will not wait for preexisting calls to finish before returning.
Calling this method before
| |
| shutdownNow | back to summary |
|---|---|
| public abstract Server shutdownNow() Initiates a forceful shutdown in which preexisting and new calls are rejected. Although
forceful, the shutdown process is still not instantaneous; Calling this method before
| |
| start | back to summary |
|---|---|
| public abstract Server start() throws IOException Bind and start the server. After this call returns, clients may begin connecting to the listening socket(s).
| |