Java Reference
In-Depth Information
logger.log(Level.INFO, new StringBuilder("entering ").append(
invocationContext.getMethod().getName()).append(
" method").toString());
Object retVal = invocationContext.proceed();
logger.log(Level.INFO, new StringBuilder("leaving ").append(
invocationContext.getMethod().getName()).append(
" method").toString());
return retVal;
}
}
As we can see, other than being annotated with our interceptor binding type, the
preceding class is a standard interceptor similar to the ones we use with EJB session
beans (refer to
Chapter 5
,
Implementing the Business Tier with Session Beans
, for details).
In order for our interceptor binding type to work properly, we need to add a CDI
configuration file (
beans.xml
) to our project.