Package com.linecorp.armeria.server
Class ContextPathAnnotatedServiceConfigSetters
java.lang.Object
com.linecorp.armeria.server.ContextPathAnnotatedServiceConfigSetters
A
ContextPathAnnotatedServiceConfigSetters
builder which configures an AnnotatedService
under a set of context paths.-
Method Summary
Modifier and TypeMethodDescriptionaccessLogFormat
(String accessLogFormat) accessLogWriter
(AccessLogWriter accessLogWriter, boolean shutdownOnStop) addHeader
(CharSequence name, Object value) addHeaders
(Iterable<? extends Map.Entry<? extends CharSequence, ?>> defaultHeaders) blockingTaskExecutor
(int numThreads) blockingTaskExecutor
(BlockingTaskExecutor blockingTaskExecutor, boolean shutdownOnStop) blockingTaskExecutor
(ScheduledExecutorService blockingTaskExecutor, boolean shutdownOnStop) Registers the given service and returns the parent object.contextHook
(Supplier<? extends AutoCloseable> contextHook) decorator
(DecoratingHttpServiceFunction decoratingHttpServiceFunction) Decorates anHttpService
with the specifieddecorator
.decorator
(Function<? super HttpService, ? extends HttpService> decorator) decorators
(Iterable<? extends Function<? super HttpService, ? extends HttpService>> decorators) decorators
(Function<? super HttpService, ? extends HttpService>... decorators) defaultLogName
(String defaultLogName) defaultServiceName
(String defaultServiceName) defaultServiceNaming
(ServiceNaming defaultServiceNaming) errorHandler
(ServiceErrorHandler serviceErrorHandler) exceptionHandlers
(ExceptionHandlerFunction... exceptionHandlerFunctions) exceptionHandlers
(Iterable<? extends ExceptionHandlerFunction> exceptionHandlerFunctions) maxRequestLength
(long maxRequestLength) multipartRemovalStrategy
(MultipartRemovalStrategy removalStrategy) multipartUploadsLocation
(Path multipartUploadsLocation) pathPrefix
(String pathPrefix) queryDelimiter
(String delimiter) Sets the delimiter for a query parameter value.requestAutoAbortDelay
(Duration delay) requestAutoAbortDelayMillis
(long delayMillis) requestConverters
(RequestConverterFunction... requestConverterFunctions) requestConverters
(Iterable<? extends RequestConverterFunction> requestConverterFunctions) requestIdGenerator
(Function<? super RoutingContext, ? extends RequestId> requestIdGenerator) requestTimeout
(Duration requestTimeout) requestTimeoutMillis
(long requestTimeoutMillis) responseConverters
(ResponseConverterFunction... responseConverterFunctions) responseConverters
(Iterable<? extends ResponseConverterFunction> responseConverterFunctions) serviceWorkerGroup
(int numThreads) serviceWorkerGroup
(EventLoopGroup serviceWorkerGroup, boolean shutdownOnStop) setHeader
(CharSequence name, Object value) setHeaders
(Iterable<? extends Map.Entry<? extends CharSequence, ?>> defaultHeaders) successFunction
(SuccessFunction successFunction) useBlockingTaskExecutor
(boolean useBlockingTaskExecutor) verboseResponses
(boolean verboseResponses)
-
Method Details
-
build
Registers the given service and returns the parent object.- Parameters:
service
- annotated service object to handle incoming requests matching path prefix, which can be configured throughAnnotatedServiceConfigSetters.pathPrefix(String)
. If path prefix is not set then this service is registered to handle requests matching/
-
pathPrefix
-
exceptionHandlers
public ContextPathAnnotatedServiceConfigSetters exceptionHandlers(ExceptionHandlerFunction... exceptionHandlerFunctions) -
exceptionHandlers
public ContextPathAnnotatedServiceConfigSetters exceptionHandlers(Iterable<? extends ExceptionHandlerFunction> exceptionHandlerFunctions) -
responseConverters
public ContextPathAnnotatedServiceConfigSetters responseConverters(ResponseConverterFunction... responseConverterFunctions) -
responseConverters
public ContextPathAnnotatedServiceConfigSetters responseConverters(Iterable<? extends ResponseConverterFunction> responseConverterFunctions) -
requestConverters
public ContextPathAnnotatedServiceConfigSetters requestConverters(RequestConverterFunction... requestConverterFunctions) -
requestConverters
public ContextPathAnnotatedServiceConfigSetters requestConverters(Iterable<? extends RequestConverterFunction> requestConverterFunctions) -
useBlockingTaskExecutor
public ContextPathAnnotatedServiceConfigSetters useBlockingTaskExecutor(boolean useBlockingTaskExecutor) -
queryDelimiter
Sets the delimiter for a query parameter value. Multiple values delimited by the specifieddelimiter
will be automatically split into a list of values.It is disabled by default.
Note that this delimiter works only when the resolve target class type is collection and the number of values of the query parameter is one. For example with the query delimiter
","
:?query=a,b,c
will be resolved to"a"
,"b"
and"c"
?query=a,b,c&query=d,e,f
will be resolved to"a,b,c"
and"d,e,f"
-
decorator
public ContextPathAnnotatedServiceConfigSetters decorator(Function<? super HttpService, ? extends HttpService> decorator) -
decorators
public ContextPathAnnotatedServiceConfigSetters decorators(Function<? super HttpService, ? extends HttpService>... decorators) -
decorators
public ContextPathAnnotatedServiceConfigSetters decorators(Iterable<? extends Function<? super HttpService, ? extends HttpService>> decorators) -
requestTimeout
-
requestTimeoutMillis
-
maxRequestLength
-
verboseResponses
-
accessLogFormat
-
accessLogWriter
public ContextPathAnnotatedServiceConfigSetters accessLogWriter(AccessLogWriter accessLogWriter, boolean shutdownOnStop) -
defaultServiceName
-
defaultServiceNaming
public ContextPathAnnotatedServiceConfigSetters defaultServiceNaming(ServiceNaming defaultServiceNaming) -
defaultLogName
-
blockingTaskExecutor
public ContextPathAnnotatedServiceConfigSetters blockingTaskExecutor(ScheduledExecutorService blockingTaskExecutor, boolean shutdownOnStop) -
blockingTaskExecutor
public ContextPathAnnotatedServiceConfigSetters blockingTaskExecutor(BlockingTaskExecutor blockingTaskExecutor, boolean shutdownOnStop) -
blockingTaskExecutor
-
successFunction
-
requestAutoAbortDelay
-
requestAutoAbortDelayMillis
-
multipartUploadsLocation
public ContextPathAnnotatedServiceConfigSetters multipartUploadsLocation(Path multipartUploadsLocation) -
multipartRemovalStrategy
@UnstableApi public ContextPathAnnotatedServiceConfigSetters multipartRemovalStrategy(MultipartRemovalStrategy removalStrategy) -
serviceWorkerGroup
public ContextPathAnnotatedServiceConfigSetters serviceWorkerGroup(EventLoopGroup serviceWorkerGroup, boolean shutdownOnStop) -
serviceWorkerGroup
-
requestIdGenerator
public ContextPathAnnotatedServiceConfigSetters requestIdGenerator(Function<? super RoutingContext, ? extends RequestId> requestIdGenerator) -
addHeader
-
addHeaders
public ContextPathAnnotatedServiceConfigSetters addHeaders(Iterable<? extends Map.Entry<? extends CharSequence, ?>> defaultHeaders) -
setHeader
-
setHeaders
public ContextPathAnnotatedServiceConfigSetters setHeaders(Iterable<? extends Map.Entry<? extends CharSequence, ?>> defaultHeaders) -
errorHandler
public ContextPathAnnotatedServiceConfigSetters errorHandler(ServiceErrorHandler serviceErrorHandler) -
contextHook
public ContextPathAnnotatedServiceConfigSetters contextHook(Supplier<? extends AutoCloseable> contextHook) -
decorator
default ContextPathAnnotatedServiceConfigSetters decorator(DecoratingHttpServiceFunction decoratingHttpServiceFunction) Decorates anHttpService
with the specifieddecorator
.- Parameters:
decoratingHttpServiceFunction
- theDecoratingHttpServiceFunction
that decoratesHttpService
s
-