Package com.linecorp.armeria.spring
Class ThriftServiceRegistrationBean
java.lang.Object
com.linecorp.armeria.spring.AbstractServiceRegistrationBean<HttpService,ThriftServiceRegistrationBean,TBase<?,?>,ExampleHeaders>
com.linecorp.armeria.spring.ThriftServiceRegistrationBean
public class ThriftServiceRegistrationBean extends AbstractServiceRegistrationBean<HttpService,ThriftServiceRegistrationBean,TBase<?,?>,ExampleHeaders>
A bean with information for registering a thrift service. Enables micrometer
monitoring of the service and registers sample requests for use in
DocService
.
> @Bean
> public ThriftServiceRegistrationBean okService() {
> return new ThriftServiceRegistrationBean()
> .setServiceName("myThriftService")
> .setPath("/my_service")
> .setService(new MyThriftService())
> .setDecorators(LoggingService.newDecorator())
> .addExampleRequests(new MyThriftService.hello_args("Armeria"))
> .addExampleHeaders(ExampleHeaders.of(AUTHORIZATION, "bearer b03c4fed1a"));
> }
-
Constructor Summary
Constructors Constructor Description ThriftServiceRegistrationBean()
-
Method Summary
Modifier and Type Method Description ThriftServiceRegistrationBean
addExampleHeaders(CharSequence name, String value)
Adds an example HTTP header for all service methods.ThriftServiceRegistrationBean
addExampleHeaders(String methodName, @NotNull HttpHeaders... exampleHeaders)
Adds example HTTP headers for the specified method.ThriftServiceRegistrationBean
addExampleHeaders(String methodName, @NotNull Iterable<? extends HttpHeaders> exampleHeaders)
Adds example HTTP headers for the specified method.ThriftServiceRegistrationBean
addExampleHeaders(String methodName, HttpHeaders exampleHeaders)
Adds an example HTTP header for the specified method.ThriftServiceRegistrationBean
addExampleHeaders(String methodName, CharSequence name, String value)
Adds an example HTTP header for the specified method.@NotNull String
getPath()
Returns the url path this service map to.ThriftServiceRegistrationBean
setPath(@NotNull String path)
Register the url path this service map to.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
-
ThriftServiceRegistrationBean
public ThriftServiceRegistrationBean()
-
-
Method Details
-
getPath
Returns the url path this service map to. -
setPath
Register the url path this service map to. -
addExampleHeaders
Adds an example HTTP header for all service methods. -
addExampleHeaders
public ThriftServiceRegistrationBean addExampleHeaders(String methodName, HttpHeaders exampleHeaders)Adds an example HTTP header for the specified method. -
addExampleHeaders
public ThriftServiceRegistrationBean addExampleHeaders(String methodName, CharSequence name, String value)Adds an example HTTP header for the specified method. -
addExampleHeaders
public ThriftServiceRegistrationBean addExampleHeaders(String methodName, @NotNull @NotNull Iterable<? extends HttpHeaders> exampleHeaders)Adds example HTTP headers for the specified method. -
addExampleHeaders
public ThriftServiceRegistrationBean addExampleHeaders(String methodName, @NotNull @NotNull HttpHeaders... exampleHeaders)Adds example HTTP headers for the specified method.
-