Creating your own interceptor
Interceptors can be configured to execute before and after a method is executed. This permits moving orthogonal functionality out of the method thus reducing the complexity and clutter of the method. As we have seen in previous chapters, interceptors have been used for a variety of tasks such as handling transactions and security. In this recipe, we will demonstrate the technique for creating our own interceptors to meet any unique requirements of our application.
The process to create and use an interceptor involves:
- Creating an interceptor binding to define the characteristics of the interceptor
- Implementing the interceptor class
- Adding the interceptor to the application
An interceptor binding is used to ...