Package com.linecorp.armeria.server
Class ServiceConfig
java.lang.Object
com.linecorp.armeria.server.ServiceConfig
An
HttpService
configuration.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the access log writer.Returns theBlockingTaskExecutor
dedicated to the execution of blocking tasks or invocations within this route.Returns theSupplier
which provides anAutoCloseable
and will be called whenever thisRequestContext
is popped from theRequestContextStorage
.Returns the default headers for anHttpResponse
served by theservice()
.Returns the default value of theRequestOnlyLog.name()
property which is used when no name was set viaRequestLogBuilder.name(String, String)
.Deprecated.Returns a default naming rule for the name of services.Returns theRoute
whose prefix is removed when anHttpServiceWithRoutes
is added viaServerBuilder.serviceUnder(String, HttpService)
.long
Returns the maximum allowed length of the content decoded at the session layer.Returns theMultipartRemovalStrategy
that specifies when to remove the temporary files created for multipart requests.Returns thePath
that is used to store uploaded file through multipart/form-data.long
Returns the amount of time to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete.long
Returns the timeout of a request.route()
server()
service()
Returns theHttpService
.Returns theEventLoopGroup
dedicated to the execution of services' methods.boolean
Deprecated.This method is not used anymore.boolean
Deprecated.This method is not used anymore.Returns theSuccessFunction
that determines whether a request was handled successfully or not.toString()
boolean
Returns whether the verbose response mode is enabled.Returns theVirtualHost
theservice()
belongs to.
-
Method Details
-
virtualHost
Returns theVirtualHost
theservice()
belongs to. -
server
-
route
-
mappedRoute
Returns theRoute
whose prefix is removed when anHttpServiceWithRoutes
is added viaServerBuilder.serviceUnder(String, HttpService)
. For example, in the following code, the path of themappedRoute()
will be ("/bar"
) whereas the path of theroute()
will be ("/foo/bar"
):
If the service is not an> HttpServiceWithRoutes serviceWithRoutes = new HttpServiceWithRoutes() { > @Override > public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) { ... } > > @Override > public Set<Route> routes() { > return Set.of(Route.builder().path("/bar").build()); > } > }; > > Server.builder() > .serviceUnder("/foo", serviceWithRoutes) > .build();
HttpServiceWithRoutes
, theRoute
is the same asroute()
. -
service
Returns theHttpService
. -
defaultServiceName
Deprecated.UsedefaultServiceNaming()
instead.Returns the default value of theRequestOnlyLog.serviceName()
property which is used when no service name was set viaRequestLogBuilder.name(String, String)
. Ifnull
, one of the following values will be used instead:- gRPC - a service name (e.g,
com.foo.GrpcService
) - Thrift - a service type (e.g,
com.foo.ThriftService$AsyncIface
orcom.foo.ThriftService$Iface
) HttpService
and annotated service - an innermost class name
- gRPC - a service name (e.g,
-
defaultServiceNaming
Returns a default naming rule for the name of services.- See Also:
-
defaultLogName
Returns the default value of theRequestOnlyLog.name()
property which is used when no name was set viaRequestLogBuilder.name(String, String)
. Ifnull
, one of the following values will be used instead:- gRPC - A capitalized method name defined in
io.grpc.MethodDescriptor
(e.g,GetItems
) - Thrift and annotated service - a method name (e.g,
getItems
) HttpService
- an HTTP method name
- gRPC - A capitalized method name defined in
-
requestTimeoutMillis
public long requestTimeoutMillis()Returns the timeout of a request.- See Also:
-
maxRequestLength
public long maxRequestLength()Returns the maximum allowed length of the content decoded at the session layer. e.g. the content length of an HTTP request.- See Also:
-
verboseResponses
public boolean verboseResponses()Returns whether the verbose response mode is enabled. When enabled, the service response will contain the exception type and its full stack trace, which may be useful for debugging while potentially insecure. When disabled, the service response will not expose such server-side details to the client.- See Also:
-
accessLogWriter
Returns the access log writer.- See Also:
-
shutdownAccessLogWriterOnStop
Deprecated.This method is not used anymore. TheAccessLogWriter
is shut down if theshutdownOnStop
ofServiceConfigSetters.accessLogWriter(AccessLogWriter, boolean)
is set totrue
.Tells whether theAccessLogWriter
is shut down when theServer
stops. -
transientServiceOptions
Returns theSet
ofTransientServiceOption
s that are enabled for theservice()
. This method always returnsTransientServiceOption.allOf()
for a non-TransientService
because only aTransientService
can opt in and out usingTransientServiceBuilder.transientServiceOptions(TransientServiceOption...)
. -
blockingTaskExecutor
Returns theBlockingTaskExecutor
dedicated to the execution of blocking tasks or invocations within this route. Note that theBlockingTaskExecutor
returned by this method does not set theServiceRequestContext
when executing a submitted task. UseServiceRequestContext.blockingTaskExecutor()
if possible. -
shutdownBlockingTaskExecutorOnStop
Deprecated.This method is not used anymore. TheblockingTaskExecutor
is shut down if theshutdownOnStop
ofServiceConfigSetters.blockingTaskExecutor(ScheduledExecutorService, boolean)
is set totrue
. -
successFunction
Returns theSuccessFunction
that determines whether a request was handled successfully or not. -
requestAutoAbortDelayMillis
public long requestAutoAbortDelayMillis()Returns the amount of time to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete. -
multipartUploadsLocation
Returns thePath
that is used to store uploaded file through multipart/form-data. -
multipartRemovalStrategy
Returns theMultipartRemovalStrategy
that specifies when to remove the temporary files created for multipart requests. -
requestIdGenerator
-
contextHook
Returns theSupplier
which provides anAutoCloseable
and will be called whenever thisRequestContext
is popped from theRequestContextStorage
. -
serviceWorkerGroup
Returns theEventLoopGroup
dedicated to the execution of services' methods. -
defaultHeaders
Returns the default headers for anHttpResponse
served by theservice()
. -
toString
-
defaultServiceNaming()
instead.