- All Known Implementing Classes:
AbstractServer
,NettyServer
@ThreadSafe public interface Server
Represents an I/O server.
-
Method Summary
Modifier and Type Method Description CompletionStage<Void>
start()
void
stop()
-
Method Details
-
start
CompletionStage<Void> start()Enables theServer
to perform I/O operations untilstop()
is invoked or until an implementation decided to cease all operations. This method is allowed to be called multiple times.- Returns:
CompletionStage
that may be used to get notified when the server stops operating, or if the server fails to start.- See Also:
start()
,stop()
-
stop
Disables theServer
so it does not perform I/O and any other operations anymore if theServer
wasstarted
, otherwise does nothing. This method is allowed to be called multiple times.- Throws:
InterruptedException
- See Also:
start()
-