Skip to content
LightGuard edited this page Jan 25, 2012 · 1 revision

Interceptors

In the Java EE specification version 6, the concept of interceptors was extracted into a separate specification. As a result, not only EJBs but any CDI-managed beans can benefit from this facility.

If you used interceptors in Seam 2, migration is very straightforward. The names and semantics of most of the annotations remain unchanged. If you used meta annotations to bind interceptors to your beans in Seam 2, this idea (slightly modified) made it into the specification and is now know as an interceptor binding.

Note that:

  • It’s not possible to declare relative ordering of interceptors anymore (if my interceptor should be invoked before or after another interceptor). Interceptors must be globally activated and ordered in the beans.xml file.
  • Stateless interceptors – the performance optimization Seam 2 used is not supported in CDI. Interceptors always share the life cycle with the bean they intercept.
Clone this wiki locally