Quantcast
Viewing latest article 22
Browse Latest Browse All 25

David Blevins' Blog: Interceptor Advisor Pattern

Image may be NSFW.
Clik here to view.
Your standard CDI/EJB Interceptor example uses a logger as an around advice. Generally this gives you an interceptor that looks like so: @Log public class LoggingInterceptor { private java.util.logging.Logger logger = java.util.logging.Logger.getLogger("theLogger"); @AroundInvoke public Object intercept(InvocationContext context) throws Exception { logger.info("" + context.getMethod().getName()); return context.proceed(); } } As of the Interceptors 1.1 sp...

Viewing latest article 22
Browse Latest Browse All 25

Trending Articles