Package com.linecorp.armeria.spring
Class AnnotatedServiceRegistrationBean
java.lang.Object
com.linecorp.armeria.spring.AbstractServiceRegistrationBean<Object,AnnotatedServiceRegistrationBean,AnnotatedExampleRequest,ExampleHeaders>
com.linecorp.armeria.spring.AnnotatedServiceRegistrationBean
@Deprecated public class AnnotatedServiceRegistrationBean extends AbstractServiceRegistrationBean<Object,AnnotatedServiceRegistrationBean,AnnotatedExampleRequest,ExampleHeaders>
Deprecated.
Use
ServerBuilder.annotatedService()
via ArmeriaServerConfigurator
and
DocServiceConfigurator
.
> @Bean
> public ArmeriaServerConfigurator myService() {
> return server -> {
> server.annotatedService()
> .pathPrefix("/my_service")
> .exceptionHandlers(new MyExceptionHandler())
> .requestConverters(new MyRequestConverter())
> .responseConverters(new MyResponseConverter())
> .decorator(LoggingService.newDecorator())
> .build(new MyAnnotatedService());
> };
> }
> @Bean
> public DocServiceConfigurator myServiceDoc() {
> return docServiceBuilder -> {
> docServiceBuilder.exampleRequestForMethod(MyAnnotatedService.class,
> "myMethod", "{\"foo\":\"bar\"}")
> .exampleHttpHeaders(MyAnnotatedService.class,
> HttpHeaders.of("my-header", "headerVal"));
> };
> }
A bean with information for registering an annotated service object.
It enables Micrometer metric collection of the service automatically.
> @Bean
> public AnnotatedServiceRegistrationBean okService() {
> return new AnnotatedServiceRegistrationBean()
> .setServiceName("myAnnotatedService")
> .setPathPrefix("/my_service")
> .setService(new MyAnnotatedService())
> .setDecorators(LoggingService.newDecorator())
> .setExceptionHandlers(new MyExceptionHandler())
> .setRequestConverters(new MyRequestConverter())
> .setResponseConverters(new MyResponseConverter())
> .addExampleRequests(AnnotatedExampleRequest.of("myMethod", "{\"foo\":\"bar\"}"))
> .addExampleHeaders(ExampleHeaders.of("my-header", "headerVal"));
> }
-
Constructor Summary
Constructors Constructor Description AnnotatedServiceRegistrationBean()
Deprecated. -
Method Summary
Methods inherited from class com.linecorp.armeria.spring.AbstractServiceRegistrationBean
addExampleHeaders, addExampleHeaders, addExampleHeaders, addExampleRequests, addExampleRequests, addExampleRequests, getDecorators, getExampleHeaders, getExampleRequests, getService, getServiceName, setDecorators, setDecorators, setExampleHeaders, setExampleHeaders, setExampleHeaders, setExampleRequests, setExampleRequests, setExampleRequests, setService, setServiceName
-
Constructor Details
-
AnnotatedServiceRegistrationBean
public AnnotatedServiceRegistrationBean()Deprecated.
-
-
Method Details
-
getPathPrefix
Deprecated.Returns the path prefix. -
setPathPrefix
@Deprecated public AnnotatedServiceRegistrationBean setPathPrefix(@NotNull @NotNull String pathPrefix)Deprecated.Sets the path prefix. -
getExceptionHandlers
Deprecated.Returns the exception handlers of the annotated service object. -
setExceptionHandlers
@Deprecated public AnnotatedServiceRegistrationBean setExceptionHandlers(Collection<? extends ExceptionHandlerFunction> exceptionHandlers)Deprecated.Sets the exception handlers of the annotated service object. -
setExceptionHandlers
@Deprecated public AnnotatedServiceRegistrationBean setExceptionHandlers(ExceptionHandlerFunction... exceptionHandlers)Sets the exception handlers of the annotated service object. -
getRequestConverters
Deprecated.Returns the request converters of the annotated service object. -
setRequestConverters
@Deprecated public AnnotatedServiceRegistrationBean setRequestConverters(Collection<? extends RequestConverterFunction> requestConverters)Deprecated.Sets the request converters of the annotated service object. -
setRequestConverters
@Deprecated public AnnotatedServiceRegistrationBean setRequestConverters(RequestConverterFunction... requestConverters)Sets the request converters of the annotated service object. -
getResponseConverters
Deprecated.Returns the response converters of the annotated service object. -
setResponseConverters
@Deprecated public AnnotatedServiceRegistrationBean setResponseConverters(Collection<? extends ResponseConverterFunction> responseConverters)Deprecated.Sets the response converters of the annotated service object. -
setResponseConverters
@Deprecated public AnnotatedServiceRegistrationBean setResponseConverters(ResponseConverterFunction... responseConverters)Sets the response converters of the annotated service object. -
addExampleRequests
@Deprecated public AnnotatedServiceRegistrationBean addExampleRequests(@NotNull @NotNull String methodName, @NotNull @NotNull Object exampleRequest)Deprecated.Adds an example request forAbstractServiceRegistrationBean.getService()
. -
addExampleHeaders
@Deprecated public AnnotatedServiceRegistrationBean addExampleHeaders(CharSequence name, String value)Deprecated.Adds an example HTTP header for all service methods. -
addExampleHeaders
@Deprecated public AnnotatedServiceRegistrationBean addExampleHeaders(String methodName, HttpHeaders exampleHeaders)Deprecated.Adds an example HTTP header for the specified method. -
addExampleHeaders
@Deprecated public AnnotatedServiceRegistrationBean addExampleHeaders(String methodName, CharSequence name, String value)Deprecated.Adds an example HTTP header for the specified method. -
addExampleHeaders
@Deprecated public AnnotatedServiceRegistrationBean addExampleHeaders(String methodName, @NotNull @NotNull Iterable<? extends HttpHeaders> exampleHeaders)Deprecated.Adds example HTTP headers for the specified method. -
addExampleHeaders
@Deprecated public AnnotatedServiceRegistrationBean addExampleHeaders(String methodName, @NotNull @NotNull HttpHeaders... exampleHeaders)Deprecated.Adds example HTTP headers for the specified method.
-