CDI Interceptors

CDI Interceptor functionality is defined in the Java Interceptors specification.

The Interceptors specification defines three kinds of interception points:

  • business method interception,
  • lifecycle callback interception, and
  • timeout method interception (EJB only).

We will explore the basics of using interceptors in CDI. A simple interceptor will be created that initializes a cutomer’s account with 10 USD.

In the above snippet we create the @InterceptorBinding which can be applied to a TYPE or a METHOD.

Next is to create the actual Interceptor class with a binding to the AccountOpeningInterceptor.

Then we apply the Interceptor to the method call that requires interception.

On that note and until the next post; keep doing cool things :smile:.

Exploring Apache DeltaSpike Data Module

A Beginner's Guide to CDI

Sping PDF REST API with JasperReports

JasperReports is a Java class library, and it is meant for those Java developers who need to add reporting capabilities to their applications.

Continue reading...

JasperReports HTML Emails with Spring

JasperReports is a library entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word.

Continue reading...
View all post (35 posts)