import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
public class MyInterceptor {
@AroundInvoke
public Object intercept(InvocationContext context) throws Exception {
Object result = context.proceed();
return result;
}
}
import javax.interceptor.Interceptors;
public class MyService {
@Interceptors(MyInterceptor.class)
public void doSomething() {
}
}
<interceptors>
<class>com.example.MyInterceptor</class>
</interceptors>