Package com.linecorp.armeria.server
Class ServiceConfig
java.lang.Object
com.linecorp.armeria.server.ServiceConfig
An
HttpService configuration.-
Method Summary
Modifier and TypeMethodDescriptionReturns the access log writer.Returns theBlockingTaskExecutordedicated to the execution of blocking tasks or invocations within this route.Returns the default headers for anHttpResponseserved 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 theRoutewhose prefix is removed when anHttpServiceWithRoutesis added viaServerBuilder.serviceUnder(String, HttpService).longReturns the maximum allowed length of the content decoded at the session layer.Returns thePaththat is used to store uploaded file through multipart/form-data.longReturns the amount of time to wait before aborting anHttpRequestwhen its correspondingHttpResponseis complete.longReturns the timeout of a request.route()server()service()Returns theHttpService.booleanDeprecated.This method is not used anymore.booleanDeprecated.This method is not used anymore.Returns theSuccessFunctionthat determines whether a request was handled successfully or not.toString()booleanReturns whether the verbose response mode is enabled.Returns theVirtualHosttheservice()belongs to.
-
Method Details
-
virtualHost
Returns theVirtualHosttheservice()belongs to. -
server
-
route
-
mappedRoute
Returns theRoutewhose prefix is removed when anHttpServiceWithRoutesis 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, theRouteis 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$AsyncIfaceorcom.foo.ThriftService$Iface) HttpServiceand 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. TheAccessLogWriteris shut down if theshutdownOnStopofServiceBindingBuilder.accessLogWriter(AccessLogWriter, boolean)is set totrue.Tells whether theAccessLogWriteris shut down when theServerstops. -
transientServiceOptions
Returns theSetofTransientServiceOptions that are enabled for theservice(). This method always returnsTransientServiceOption.allOf()for a non-TransientServicebecause only aTransientServicecan opt in and out usingTransientServiceBuilder.transientServiceOptions(TransientServiceOption...). -
blockingTaskExecutor
Returns theBlockingTaskExecutordedicated to the execution of blocking tasks or invocations within this route. Note that theBlockingTaskExecutorreturned by this method does not set theServiceRequestContextwhen executing a submitted task. UseServiceRequestContext.blockingTaskExecutor()if possible. -
shutdownBlockingTaskExecutorOnStop
Deprecated.This method is not used anymore. TheblockingTaskExecutoris shut down if theshutdownOnStopofServiceBindingBuilder.blockingTaskExecutor(ScheduledExecutorService, boolean)is set totrue. -
successFunction
Returns theSuccessFunctionthat determines whether a request was handled successfully or not. -
requestAutoAbortDelayMillis
public long requestAutoAbortDelayMillis()Returns the amount of time to wait before aborting anHttpRequestwhen its correspondingHttpResponseis complete. -
multipartUploadsLocation
Returns thePaththat is used to store uploaded file through multipart/form-data. -
requestIdGenerator
-
defaultHeaders
Returns the default headers for anHttpResponseserved by theservice(). -
toString
-
defaultServiceNaming()instead.