Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is a… interceptor?

interceptor
0
Posted

What is a… interceptor?

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.