mirror of https://github.com/grpc/grpc-java.git
parent
3668f2e52c
commit
0e7e0b4f57
|
|
@ -43,7 +43,7 @@ public abstract class Server {
|
|||
* listening socket(s).
|
||||
*
|
||||
* @return {@code this} object
|
||||
* @throws IllegalStateException if already started
|
||||
* @throws IllegalStateException if already started or shut down
|
||||
* @throws IOException if unable to bind
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -119,6 +119,9 @@ public abstract class Server {
|
|||
* {@link #awaitTermination()} or {@link #awaitTermination(long, TimeUnit)} needs to be called to
|
||||
* wait for existing calls to finish.
|
||||
*
|
||||
* <p>Calling this method before {@code start()} will shut down and terminate the server like
|
||||
* normal, but prevents starting the server in the future.
|
||||
*
|
||||
* @return {@code this} object
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -130,6 +133,9 @@ public abstract class Server {
|
|||
* return {@code false} immediately after this method returns. After this call returns, this
|
||||
* server has released the listening socket(s) and may be reused by another server.
|
||||
*
|
||||
* <p>Calling this method before {@code start()} will shut down and terminate the server like
|
||||
* normal, but prevents starting the server in the future.
|
||||
*
|
||||
* @return {@code this} object
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -157,6 +163,9 @@ public abstract class Server {
|
|||
/**
|
||||
* Waits for the server to become terminated, giving up if the timeout is reached.
|
||||
*
|
||||
* <p>Calling this method before {@code start()} or {@code shutdown()} is permitted and does not
|
||||
* change its behavior.
|
||||
*
|
||||
* @return whether the server is terminated, as would be done by {@link #isTerminated()}.
|
||||
*/
|
||||
public abstract boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException;
|
||||
|
|
@ -164,6 +173,9 @@ public abstract class Server {
|
|||
/**
|
||||
* Waits for the server to become terminated.
|
||||
*
|
||||
* <p>Calling this method before {@code start()} or {@code shutdown()} is permitted and does not
|
||||
* change its behavior.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public abstract void awaitTermination() throws InterruptedException;
|
||||
|
|
|
|||
Loading…
Reference in New Issue