What is a… interceptor?
An interceptor is an object that may be placed between the client and a service. Every request to the service is thus intercepted by that object, which can do operations on the request (such as logging) and may even reroute or ignore the request altogether. This provides a kind of “poor man’s AOP”, since you can do “before”, “after”, and “around” advice on the methods of a service. Needle comes with one standard interceptor, the LoggingInterceptor. It will log a message on method entry and exit, and also when an exception is raised.