The Spring Framework has evolved over the years, introducing interceptors for various features such as caching and asynchronous method execution. The purpose of this document is to describe those interceptors and see what we can harmonize. It’s also a chance to look at a way to mutualize some processing and hopefully improve the processing time if need to be.
This summarizes the core interceptors that are defined by the framework
Annotation | Enable Annotation | Interceptor | Description |
---|---|---|---|
|
|
|
Create a proxy to delegate the processing to a separate thread |
|
|
|
Pointcut-based interceptor, cache result of method invocation |
|
automatic |
|
Register an |
|
|
|
Create a JMS listener container on the fly for the annotated method |
|
|
|
Invoke a given method at the configured rate |
|
|
|
Pointcut-based interceptor, manage transaction boundaries |
|
none |
|
Validate method arguments and return types |
The table belows summarizes the features of each interceptor. This should give a proper overview of what we could share for reuse
Feature | Service Qualifier | Method-based inspection |
---|---|---|
|
yes |
no |
|
n/a |
no |
|
n/a |
yes |
|
yes |
yes |
|
desirable (?) |
yes |
|
yes |
no |
|
desirable |
no |