Package com.linecorp.armeria.spring
Class AbstractServiceRegistrationBean<T,U,V,W>
java.lang.Object
com.linecorp.armeria.spring.AbstractServiceRegistrationBean<T,U,V,W>
- Type Parameters:
T
- the type of the service object to be registeredU
- the type of the implementation of this beanV
- the type of the example request object to be registeredW
- the type of the example header object to be registered
- Direct Known Subclasses:
AnnotatedServiceRegistrationBean
,GrpcServiceRegistrationBean
,HttpServiceRegistrationBean
,ThriftServiceRegistrationBean
public class AbstractServiceRegistrationBean<T,U,V,W> extends Object
An abstract bean with information for registering a service object.
It enables Micrometer metric collection of the service automatically.
-
Constructor Summary
Constructors Constructor Description AbstractServiceRegistrationBean()
-
Method Summary
Modifier and Type Method Description U
addExampleHeaders(@NotNull Iterable<? extends W> exampleHeaders)
Adds example HTTP headers for all service methods.U
addExampleHeaders(@NotNull W... exampleHeaders)
Adds example HTTP headers for all service methods.U
addExampleHeaders(W exampleHeaders)
Adds an example HTTP header for all service methods.U
addExampleRequests(@NotNull Iterable<? extends V> exampleRequests)
Adds example requests forgetService()
.U
addExampleRequests(@NotNull V... exampleRequests)
Adds example requests forgetService()
.U
addExampleRequests(V exampleRequest)
Adds an example request forgetService()
.@NotNull List<Function<? super HttpService,? extends HttpService>>
getDecorators()
Returns the decorators of the annotated service object.@NotNull Collection<? extends W>
getExampleHeaders()
Returns example HTTP headers for all service methods.@NotNull Collection<? extends V>
getExampleRequests()
Returns example requests ofgetService()
.T
getService()
Returns the annotated service object registered to this bean.@NotNull String
getServiceName()
Returns this service name to use in monitoring.U
setDecorators(Function<? super HttpService,? extends HttpService>... decorators)
Sets the decorator of the annotated service object.U
setDecorators(List<Function<? super HttpService,? extends HttpService>> decorators)
Sets the decorators of the annotated service object.U
setExampleHeaders(@NotNull Iterable<? extends W> exampleHeaders)
Sets example HTTP headers for all service methods.U
setExampleHeaders(@NotNull Collection<? extends W> exampleHeaders)
Sets example HTTP headers for all service methods.U
setExampleHeaders(@NotNull W... exampleHeaders)
Sets example HTTP headers for all service methods.U
setExampleRequests(@NotNull Iterable<? extends V> exampleRequests)
Sets example requests forgetService()
.U
setExampleRequests(@NotNull Collection<? extends V> exampleRequests)
Sets example requests forgetService()
.U
setExampleRequests(@NotNull V... exampleRequests)
Sets example requests forgetService()
.U
setService(T service)
Registers an annotated service object.U
setServiceName(@NotNull String serviceName)
Sets service name to use in monitoring.
-
Constructor Details
-
AbstractServiceRegistrationBean
public AbstractServiceRegistrationBean()
-
-
Method Details
-
getService
Returns the annotated service object registered to this bean. -
setService
Registers an annotated service object. -
getServiceName
Returns this service name to use in monitoring. -
setServiceName
Sets service name to use in monitoring. -
getDecorators
@NotNull public final @NotNull List<Function<? super HttpService,? extends HttpService>> getDecorators()Returns the decorators of the annotated service object. -
setDecorators
@SafeVarargs public final U setDecorators(Function<? super HttpService,? extends HttpService>... decorators)Sets the decorator of the annotated service object.decorators
are applied toservice
in order. -
setDecorators
public final U setDecorators(List<Function<? super HttpService,? extends HttpService>> decorators)Sets the decorators of the annotated service object.decorators
are applied toservice
in order. -
getExampleRequests
Returns example requests ofgetService()
. -
setExampleRequests
Sets example requests forgetService()
. -
setExampleRequests
Sets example requests forgetService()
. -
setExampleRequests
Sets example requests forgetService()
. -
addExampleRequests
Adds example requests forgetService()
. -
addExampleRequests
Adds example requests forgetService()
. -
addExampleRequests
Adds an example request forgetService()
. -
getExampleHeaders
Returns example HTTP headers for all service methods. -
setExampleHeaders
Sets example HTTP headers for all service methods. -
setExampleHeaders
Sets example HTTP headers for all service methods. -
setExampleHeaders
Sets example HTTP headers for all service methods. -
addExampleHeaders
Adds example HTTP headers for all service methods. -
addExampleHeaders
Adds example HTTP headers for all service methods. -
addExampleHeaders
Adds an example HTTP header for all service methods.
-