public class GlobalClientInterceptorRegistry extends Object implements ApplicationContextAware
ClientInterceptor
s that should be registered
globally. The interceptors will be applied in the same order they as specified by the sortInterceptors(List)
method.
Note: Custom interceptors will be appended to the global interceptors and applied using
ClientInterceptors.interceptForward(io.grpc.Channel, ClientInterceptor...)
.
Constructor and Description |
---|
GlobalClientInterceptorRegistry() |
Modifier and Type | Method and Description |
---|---|
GlobalClientInterceptorRegistry |
addClientInterceptors(ClientInterceptor interceptor)
Adds the given
ClientInterceptor to the list of globally registered interceptors. |
com.google.common.collect.ImmutableList<ClientInterceptor> |
getClientInterceptors()
Gets the immutable and sorted list of global server interceptors.
|
void |
init() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
sortInterceptors(List<? extends ClientInterceptor> interceptors)
Sorts the given list of interceptors.
|
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
@PostConstruct public void init()
public GlobalClientInterceptorRegistry addClientInterceptors(ClientInterceptor interceptor)
ClientInterceptor
to the list of globally registered interceptors.interceptor
- The interceptor to add.public com.google.common.collect.ImmutableList<ClientInterceptor> getClientInterceptors()
public void sortInterceptors(List<? extends ClientInterceptor> interceptors)
AnnotationAwareOrderComparator
.interceptors
- The interceptors to sort.