public interface Server
Server server = new Netty(); // or Jetty or Utow
App app = new App();
server.start(app);
...
server.stop();
Modifier and Type | Interface and Description |
---|---|
static class |
Server.Base
Base class for server.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAddressInUse(Predicate<Throwable> predicate)
Add an address in use predicate.
|
static void |
addConnectionLost(Predicate<Throwable> predicate)
Add a connection lost predicate.
|
static boolean |
connectionLost(Throwable cause)
Test whenever the given exception is a connection-lost.
|
ServerOptions |
getOptions()
Get server options.
|
static boolean |
isAddressInUse(Throwable cause)
Whenever the given exception is an address already in use.
|
default void |
join()
Deprecated.
This method is planned to be removed in next major release (3.x)
|
Server |
setOptions(ServerOptions options)
Set server options.
|
Server |
start(Jooby application)
Start an application.
|
Server |
stop()
Stop the server.
|
@Nonnull Server setOptions(@Nonnull ServerOptions options)
options
- Server options.@Nonnull ServerOptions getOptions()
@Nonnull Server start(@Nonnull Jooby application)
application
- Application to start.@Deprecated @Nonnull default void join()
static void addConnectionLost(@Nonnull Predicate<Throwable> predicate)
predicate
- Customize connection lost error.static void addAddressInUse(@Nonnull Predicate<Throwable> predicate)
predicate
- Customize connection lost error.static boolean connectionLost(@Nullable Throwable cause)
cause
- Exception to check.Copyright © 2022. All rights reserved.