public final class NettyHttpService extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
NettyHttpService.Builder
Builder to help create the NettyHttpService.
|
| Modifier and Type | Method and Description |
|---|---|
static NettyHttpService.Builder |
builder(String serviceName)
Creates a
NettyHttpService.Builder for creating new instance of NettyHttpService. |
InetSocketAddress |
getBindAddress() |
String |
getServiceName() |
boolean |
isSSLEnabled() |
void |
start()
Starts the HTTP service.
|
void |
stop()
Stops the HTTP service gracefully and release all resources.
|
void |
stop(long quietPeriod,
long timeout,
TimeUnit unit)
Stops the HTTP service gracefully and release all resources.
|
public static NettyHttpService.Builder builder(String serviceName)
NettyHttpService.Builder for creating new instance of NettyHttpService.serviceName - name of the http service. The name will be used to name threads created for the service.public void start()
throws Exception
Exception - if the service failed to startedpublic InetSocketAddress getBindAddress()
public String getServiceName()
public boolean isSSLEnabled()
true if SSL is enabled for this service.public void stop()
throws Exception
stop(long, long, TimeUnit)
with 0 second quiet period and 5 seconds timeout.Exception - if there is exception raised during shutdown.public void stop(long quietPeriod,
long timeout,
TimeUnit unit)
throws Exception
quietPeriod - the quiet period as described in the documentation of EventExecutorGrouptimeout - the maximum amount of time to wait until the executor is
EventExecutorGroup.shutdown()
regardless if a task was submitted during the quiet periodunit - the unit of quietPeriod and timeoutException - if there is exception raised during shutdown.Copyright 2021 Cask, Inc. Licensed under the Apache License, Version 2.0