Tuesday Jan 06, 2015

Interceptors in Java EE

Interceptors are used to implement cross-cutting concerns such as auditing, logging, security related tasks, etc. from the actual business logic.  Interceptors provide a clean separation between those cross-cutting concerns and the rest of the application logic.  Overall, this separation simplify the development and the maintenance of the application.

Interceptors are not new.  In fact, interceptors are nearly a decade old as the initial interceptor support has been introduced in Java EE 5... in the EJB 3.0 specification to be more precise.  But in those nearly 10 years, Interceptors have evolved quite a lot and have now their own specification.  The fact that interceptors are now independent of the EJB specification broadens their scope and reach to the complete Java EE platform.

Abhishek Gupta recently wrote a nice post on Interceptors.  In his article, Abhishek start with the history of Interceptors and then goes on the different type of Interceptors and how to use them. And as usual, you can also check the Java EE Tutorial section on Interceptors and this sample if you want to learn about Interceptors.

Tuesday Jan 31, 2012

Transactional interceptors - request for feedback

The Java EE 7 expert group has been defining transactional interceptors and there are a few issues it came across for which your developer feedback would be useful.


Bill Shannon has described the issues of :
how to handle exceptions that are thrown out of a transactional method and
how the new JTA transactional interceptor should interact with EJBs.
... and offers possible solutions.

If you care about these, please take a little bit of time to read through the above descriptions before you provide feedback. The best place for feedback would be the mailing list (subscription required first) but we'll also consider comments posted to this entry.