Quantcast
Channel: JavaPins - Stories tagged with design pattern
Viewing all articles
Browse latest Browse all 25

David Blevins' Blog: Interceptor Advisor Pattern

$
0
0
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...
Pin it

Viewing all articles
Browse latest Browse all 25

Trending Articles