package examples.stateless.interceptors; import javax.interceptor.AroundInvoke; import javax.interceptor.InvocationContext; public class AuditorInterceptor { @AroundInvoke public Object checkCost(InvocationContext inv) throws Exception { if (inv.getMethod().getName().startsWith("getTax")) { Object[] o = inv.getParameters(); double cost = ((Double)o[0]).doubleValue(); if (cost > 50) { System.out.println("Cost is > 50!"); } } return inv.proceed(); } }