I am working with Sitebricks I like it. I wonder,however, what the best approach for services intercepting for cross-cutting tasks, is ? 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 of this approach ?