super.stop(svc);
}
public void run() {
while ( run ) {
LinkObject link = queue.remove();
if ( link == null ) continue; //should not happen unless we exceed wait time
while ( link != null && run ) {
ChannelMessage msg = link.data();
Member[] destination = link.getDestination();
try {
super.sendMessage(destination,msg,null);
try {
if ( link.getHandler() != null ) link.getHandler().handleCompletion(destination,msg);
} catch ( Exception ex ) {
log.error("Unable to report back completed message.",ex);
}
} catch ( Exception x ) {
if ( log.isDebugEnabled() ) log.debug("Error while processing async message.",x);
try {
if (link.getHandler() != null) link.getHandler().handleError(x, destination, msg);
} catch ( Exception ex ) {
log.error("Unable to report back error message.",ex);
}
} finally {
currentSize.addAndGet(-msg.getMessage().getLength());
link = link.next();
}//try
}//while
}//while
}//run