O'Reilly logo

Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications by Mick Knutson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding advice with CDI Decorators

Interceptors are a powerful solution to capture and separate concerns that are orthogonal to an application. An Interceptor is able to intercept any java-type invocation. Just like aspects, interceptors are perfect for solving technical issues such as transaction management, security, logging, and auditing. By nature, interceptors are not aware of the semantics of the event calls they intercept.

A decorator intercepts invocations only for given Java interface type, and is aware of all the semantics associated with that interface. As decorators directly implement the interface they are decorating with additional business logic, it is more suited for specific business concerns, not cross-cutting concerns such as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required