public interface Interceptor
An interceptor will be called instead of the normal method invocation for proxied beans. A typical scenario for an Interceptor is transaction handling:
public Object intercept(Object bean, Method method, Object[] args) throws Exception {
startTransaction();
try {
method.invoke(bean, args);
commitTransaction();
} catch (Exception ex) {
rollbackTransaction();
} finally {
closeTransaction();
}
}
The Interceptor, as any other bean, can enjoy depdendency injection via the @Inject annotation.InterceptCopyright © 2011 Syse Data AS. All Rights Reserved.