Java EE: Logging User Interaction the Aspect-Oriented Way using Interceptors

Using dependency injection and aspect-oriented mechanisms like interceptors allow us to separate cross-cutting-concerns in our Java enterprise application, to control global aspects of our application and to avoid boilerplate code. In the following short tutorial we’re going to create an aspect-oriented logger to protocol the initiating user, class and method called and the parameters passed to the method and finally we’re adding this interceptor to a sample RESTful web-service by adding a simple annotation. ...

May 26, 2014 · 6 min · 1275 words · Micha Kops

Java EE 6, GlassFish and the Interceptor API

Aspect oriented programming and the definition of cross-cutting-concerns is made easy in Java EE 6 using interceptors. In the following tutorial we’re going to take a look at the different possibilities to apply interceptors to your EJBs at class or method level and how to setup a GlassFish instance to run the examples. Prerequisites We don’t need much for the following tutorial – just a JDK, Maven and GlassFish… Java Development Kit 6 GlassFish 3.1 Maven 3 ...

August 17, 2011 · 8 min · 1619 words · Micha Kops