if (direction == Direction.OUT) {
for (; i <= end; i++) {
try {
switchContext(direction, i);
Handler handler = (Handler) handlers.get(i);
if (log.isDebugEnabled()) {
log.debug("Invoking close on: " + handler.getClass().getName());
}
handler.close(currentMC);
// TODO when we close, are we done with the handler instance, and thus
// may call the PreDestroy annotated method? I don't think so, especially
// if we've cached the handler list somewhere.
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("An Exception occurred while calling handler.close()");
log.debug("Exception: " + e.getClass().getName() + ":" + e.getMessage());
}
}
}
} else { // IN case
for (; i >= end; i--) {
try {
switchContext(direction, i);
Handler handler = (Handler) handlers.get(i);
if (log.isDebugEnabled()) {
log.debug("Invoking close on: " + handler.getClass().getName());
}
handler.close(currentMC);
// TODO when we close, are we done with the handler instance, and thus
// may call the PreDestroy annotated method? I don't think so, especially
// if we've cached the handler list somewhere.
} catch (Exception e) {