public class BlockingNettyContext extends Object
NettyContext obtained from a Mono and offer methods to manage
its lifecycle in a blocking fashion.| Constructor and Description |
|---|
BlockingNettyContext(Mono<? extends NettyContext> contextAsync,
String description) |
BlockingNettyContext(Mono<? extends NettyContext> contextAsync,
String description,
java.time.Duration lifecycleTimeout) |
| Modifier and Type | Method and Description |
|---|---|
NettyContext |
getContext()
Get the
NettyContext wrapped by this facade. |
String |
getHost()
Return the server's host String.
|
int |
getPort()
Return this server's port.
|
protected Thread |
getShutdownHook() |
void |
installShutdownHook()
Install a
JVM shutdown hook that will
shutdown this BlockingNettyContext if the JVM is terminated externally. |
boolean |
removeShutdownHook()
|
void |
setLifecycleTimeout(java.time.Duration timeout)
Change the lifecycle timeout applied to the
shutdown() operation (as this can
only be called AFTER the NettyContext has been "started"). |
void |
shutdown()
Shut down the
NettyContext and wait for its termination, up to the
lifecycle timeout. |
protected void |
shutdownFromJVM() |
public BlockingNettyContext(Mono<? extends NettyContext> contextAsync, String description)
public BlockingNettyContext(Mono<? extends NettyContext> contextAsync, String description, java.time.Duration lifecycleTimeout)
public void setLifecycleTimeout(java.time.Duration timeout)
shutdown() operation (as this can
only be called AFTER the NettyContext has been "started").timeout - the new timeout to apply on shutdown.public NettyContext getContext()
NettyContext wrapped by this facade.public int getPort()
public String getHost()
NettyContext.address(),
InetSocketAddress.getHostString()public void installShutdownHook()
JVM shutdown hook that will
shutdown this BlockingNettyContext if the JVM is terminated externally.
The hook is removed if shutdown manually, and subsequent calls to this method are no-op.
public boolean removeShutdownHook()
protected Thread getShutdownHook()
public void shutdown()
NettyContext and wait for its termination, up to the
lifecycle timeout.protected void shutdownFromJVM()