Hi guys , I am working with Sitebricks for quite a time and I like it. I wander what best approach for services intercepting, for cross-cutting tasks, are ? Logging, Validation, Exception Handling, are all tasks to be put in an interceptors like components.
Currently I am doing it with AOP on the services like so :
bindInterceptor(annotatedWith(Service.class), returns(only(Reply.class)), new HttpRequestFailureReportInterceptor(new MessageAcceptor() {
@Override
public void accept(String message) {
Logger logger = LoggerFactory.getLogger(this.getClass());
logger.debug(message);
}
}));
Is this a good way to accomplish tasks like that ? If no, why ? What are advantages and drawback for this approach ?