public class GlobalServerInterceptorRegistry extends Object implements ApplicationContextAware
ServerInterceptor
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
ServerInterceptors.interceptForward(BindableService, ServerInterceptor...)
.
Constructor and Description |
---|
GlobalServerInterceptorRegistry() |
Modifier and Type | Method and Description |
---|---|
GlobalServerInterceptorRegistry |
addServerInterceptors(ServerInterceptor interceptor)
Adds the given
ServerInterceptor to the list of globally registered interceptors. |
com.google.common.collect.ImmutableList<ServerInterceptor> |
getServerInterceptors()
Gets the immutable and sorted list of global server interceptors.
|
void |
init() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
sortInterceptors(List<? extends ServerInterceptor> interceptors)
Sorts the given list of interceptors.
|
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
@PostConstruct public void init()
public GlobalServerInterceptorRegistry addServerInterceptors(ServerInterceptor interceptor)
ServerInterceptor
to the list of globally registered interceptors.interceptor
- The interceptor to add.public com.google.common.collect.ImmutableList<ServerInterceptor> getServerInterceptors()
public void sortInterceptors(List<? extends ServerInterceptor> interceptors)
AnnotationAwareOrderComparator
.interceptors
- The interceptors to sort.