Package com.linecorp.armeria.server
Class ServerConfig
- java.lang.Object
-
- com.linecorp.armeria.server.ServerConfig
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer<RequestLog>
accessLogWriter()
Returns an access log writer.ExecutorService
blockingTaskExecutor()
Returns theExecutorService
dedicated to the execution of blocking tasks or invocations.Map<ChannelOption<?>,?>
channelOptions()
Returns theChannelOption
s and their values ofServer
's server sockets.Map<ChannelOption<?>,?>
childChannelOptions()
Returns theChannelOption
s and their values of sockets accepted byServer
.int
defaultMaxHttp1ChunkSize()
Returns the default maximum length of each chunk in an HTTP/1 response content.int
defaultMaxHttp1HeaderSize()
Returns the default maximum length of all headers in an HTTP/1 response.int
defaultMaxHttp1InitialLineLength()
Returns the default maximum length of an HTTP/1 response initial line.long
defaultMaxRequestLength()
Returns the default maximum allowed length of the content decoded at the session layer.long
defaultRequestTimeoutMillis()
Returns the default timeout of a request.VirtualHost
defaultVirtualHost()
Returns the defaultVirtualHost
, which is used when no otherVirtualHost
s match the host name of a client request. e.g. the"Host"
header in HTTP or host name in TLS SNI extensionVirtualHost
findVirtualHost(String hostname)
Finds theVirtualHost
that matches the specifiedhostname
.List<VirtualHost>
findVirtualHosts(Service<?,?> service)
Duration
gracefulShutdownQuietPeriod()
Returns the number of milliseconds to wait for active requests to go end before shutting down.Duration
gracefulShutdownTimeout()
Returns the number of milliseconds to wait before shutting down the server regardless of active requests.long
idleTimeoutMillis()
Returns the idle timeout of a connection in milliseconds for keep-alive.int
maxNumConnections()
Returns the maximum allowed number of open connections.MeterRegistry
meterRegistry()
Returns theMeterRegistry
that collects various stats.List<ServerPort>
ports()
Returns theServerPort
s to listen on.int
proxyProtocolMaxTlvSize()
Returns the maximum size of additional data (TLV, Tag-Length-Value).Server
server()
Returns theServer
.List<ServiceConfig>
serviceConfigs()
String
serviceLoggerPrefix()
Returns the prefix of service logger's names.boolean
shutdownWorkerGroupOnStop()
Returns whether the workerEventLoopGroup
is shut down when theServer
stops.String
toString()
List<VirtualHost>
virtualHosts()
Returns theList
of availableVirtualHost
s.EventLoopGroup
workerGroup()
Returns the workerEventLoopGroup
which is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request)
.
-
-
-
Method Detail
-
ports
public List<ServerPort> ports()
Returns theServerPort
s to listen on.- See Also:
Server.activePorts()
-
defaultVirtualHost
public VirtualHost defaultVirtualHost()
Returns the defaultVirtualHost
, which is used when no otherVirtualHost
s match the host name of a client request. e.g. the"Host"
header in HTTP or host name in TLS SNI extension- See Also:
virtualHosts()
-
virtualHosts
public List<VirtualHost> virtualHosts()
Returns theList
of availableVirtualHost
s.- Returns:
- the
List
of availableVirtualHost
s where its lastVirtualHost
isdefaultVirtualHost()
-
findVirtualHost
public VirtualHost findVirtualHost(String hostname)
Finds theVirtualHost
that matches the specifiedhostname
. If there's no match, thedefaultVirtualHost()
is returned.
-
findVirtualHosts
public List<VirtualHost> findVirtualHosts(Service<?,?> service)
Finds theList
ofVirtualHost
s that contains the specifiedService
. If there's no match, an emptyList
is returned. Note that this is potentially an expensive operation and thus should not be used in a performance-sensitive path.
-
serviceConfigs
public List<ServiceConfig> serviceConfigs()
-
workerGroup
public EventLoopGroup workerGroup()
Returns the workerEventLoopGroup
which is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request)
.
-
shutdownWorkerGroupOnStop
public boolean shutdownWorkerGroupOnStop()
Returns whether the workerEventLoopGroup
is shut down when theServer
stops.
-
channelOptions
public Map<ChannelOption<?>,?> channelOptions()
Returns theChannelOption
s and their values ofServer
's server sockets.
-
childChannelOptions
public Map<ChannelOption<?>,?> childChannelOptions()
Returns theChannelOption
s and their values of sockets accepted byServer
.
-
maxNumConnections
public int maxNumConnections()
Returns the maximum allowed number of open connections.
-
idleTimeoutMillis
public long idleTimeoutMillis()
Returns the idle timeout of a connection in milliseconds for keep-alive.
-
defaultRequestTimeoutMillis
public long defaultRequestTimeoutMillis()
Returns the default timeout of a request.
-
defaultMaxRequestLength
public long defaultMaxRequestLength()
Returns the default maximum allowed length of the content decoded at the session layer. e.g. the content length of an HTTP request.
-
defaultMaxHttp1InitialLineLength
public int defaultMaxHttp1InitialLineLength()
Returns the default maximum length of an HTTP/1 response initial line.
-
defaultMaxHttp1HeaderSize
public int defaultMaxHttp1HeaderSize()
Returns the default maximum length of all headers in an HTTP/1 response.
-
defaultMaxHttp1ChunkSize
public int defaultMaxHttp1ChunkSize()
Returns the default maximum length of each chunk in an HTTP/1 response content. The content or a chunk longer than this value will be split into smaller chunks so that their lengths never exceed it.
-
gracefulShutdownQuietPeriod
public Duration gracefulShutdownQuietPeriod()
Returns the number of milliseconds to wait for active requests to go end before shutting down.0
means the server will stop right away without waiting.
-
gracefulShutdownTimeout
public Duration gracefulShutdownTimeout()
Returns the number of milliseconds to wait before shutting down the server regardless of active requests.
-
blockingTaskExecutor
public ExecutorService blockingTaskExecutor()
Returns theExecutorService
dedicated to the execution of blocking tasks or invocations. Note that theExecutorService
returned by this method does not set theServiceRequestContext
when executing a submitted task. UseServiceRequestContext.blockingTaskExecutor()
if possible.
-
meterRegistry
public MeterRegistry meterRegistry()
Returns theMeterRegistry
that collects various stats.
-
serviceLoggerPrefix
public String serviceLoggerPrefix()
Returns the prefix of service logger's names.
-
accessLogWriter
public Consumer<RequestLog> accessLogWriter()
Returns an access log writer.
-
proxyProtocolMaxTlvSize
public int proxyProtocolMaxTlvSize()
Returns the maximum size of additional data (TLV, Tag-Length-Value). It is only used when PROXY protocol is enabled on the server port.
-
-