O'Reilly logo

EJB 3.1 Cookbook by Richard M. Reese

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

Using the InvocationContext to verify parameters

The InvocationContext interface is used to support information handling within and between interceptors. It is passed as the single argument to a method annotated with the @AroundInvoke annotation. It possesses several methods which can assist in the handling of interceptors. In this recipe we will focus on those methods which provide access to the target method's parameter list and use them to manipulate the parameters.

Getting ready

The basic approach for using an interceptor to validate a target method's parameters involves:

  1. Accessing the target's parameters using the getParameters method
  2. Validating and possibly modifying the parameters
  3. Using the setParameters method to apply any changes to the parameters ...

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