private final class CompleteListeners extends AbstractListeners<IBodyCompleteListener> {
@Override
void onCall(final IBodyCompleteListener listener) throws IOException {
BodyCompeleteListenerInfo info = HttpUtils.getBodybodyCompeleteListenerInfo(listener);
if (info.isUnsynchronized()) {
listener.onComplete();
} else {
Runnable task = new Runnable() {
public void run() {
try {
listener.onComplete();
} catch (IOException ioe) {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("[" + getId() + "] Error occured by calling complete listener " + listener + " " + ioe.toString());
}
destroy(ioe.toString());
}
}
};
if (info.isMultithreaded()) {
getExecutor().processMultithreaded(task);
} else {
getExecutor().processNonthreaded(task);
}
}