ChannelMessage msg = link.data();
Member[] destination = link.getDestination();
try {
super.sendMessage(destination,msg,null);
try {
if ( link.getHandler() != null ) link.getHandler().handleCompletion(new UniqueId(msg.getUniqueId()));
} catch ( Exception ex ) {
log.error("Unable to report back completed message.",ex);
}
} catch ( Exception x ) {
ChannelException cx = null;
if ( x instanceof ChannelException ) cx = (ChannelException)x;
else cx = new ChannelException(x);
if ( log.isDebugEnabled() ) log.debug("Error while processing async message.",x);
try {
if (link.getHandler() != null) link.getHandler().handleError(cx, new UniqueId(msg.getUniqueId()));
} catch ( Exception ex ) {
log.error("Unable to report back error message.",ex);
}
} finally {
addAndGetCurrentSize(-msg.getMessage().getLength());