7.6.2. Create a Container Interceptor Class


Container interceptor classes are simple Plain Old Java Objects (POJOs). They use the @javax.annotation.AroundInvoke to mark the method that is invoked during the invocation on the bean.

The following is an example of a container interceptor class that marks the iAmAround method for invocation:

Example 7.1. Container Interceptor Class Example

public class ClassLevelContainerInterceptor {
    private Object iAmAround(final InvocationContext invocationContext) throws Exception {
        return this.getClass().getName() + " " + invocationContext.proceed();
For an example of a container interceptor descriptor file configured to use this class, see the jboss-ejb3.xml file described here: Section 7.6.3, “Configure a Container Interceptor”.