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 will be 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();

To see an example of a container interceptor descriptor file configured to use this class, refer to the example jboss-ejb3.xml file here: Section 7.6.3, “Configure a Container Interceptor”.