Chapter 8. Interceptors

In this chapter, we will cover:

  • Creating the Registration Application
  • Defining and using interceptors
  • Using the InvocationContext to verify parameters
  • Using interceptors to enforce security
  • Using interceptors to handle transactions
  • Using interceptors to handle application statistics
  • Using lifecycle methods in interceptors


Most applications have cross-cutting functions which must be performed. These cross-cutting functions may include logging, managing transactions, security, and other aspects of an application. Interceptors provide a way to achieve these cross-cutting activities.

The use of interceptors provides a way of adding functionality to a business method without modifying the business method itself. The added ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.