setState(message, iterator);
}
try {
while (iterator.hasNext()) {
Interceptor currentInterceptor = iterator.next();
if (LOG.isDebugEnabled()) {
LOG.debug("Invoking handleMessage on interceptor " + currentInterceptor.getId());
}
currentInterceptor.handleMessage(message);
}
} catch (RuntimeException ex) {
if (LOG.isInfoEnabled()) {
LOG.info("Interceptor has thrown exception, unwinding now", ex);
}
message.setContent(Exception.class, ex);
// Unwind
while (iterator.hasPrevious()) {
Interceptor currentInterceptor = iterator.previous();
if (LOG.isDebugEnabled()) {
LOG.debug("Invoking handleFault on interceptor " + currentInterceptor.getId());
}
currentInterceptor.handleFault(message);
}
throw ex;
}
}