Request request = (Request) req.getNote(ADAPTER_NOTES);
Response response = (Response) res.getNote(ADAPTER_NOTES);
if (request.getWrapper() != null) {
CometProcessor servlet = null;
// Bind the context CL to the current thread
if (request.getContext().getLoader() != null ) {
Thread.currentThread().setContextClassLoader
(request.getContext().getLoader().getClassLoader());
}
try {
servlet = (CometProcessor) request.getWrapper().allocate();
if (error) {
servlet.error(request.getRequest(), response.getResponse());
} else {
if (!servlet.read(request.getRequest(), response.getResponse())) {
error = true;
try {
servlet.error(request.getRequest(), response.getResponse());
} catch (Throwable th) {
log.error(sm.getString("coyoteAdapter.service"), th);
}
}
}
if (response.isClosed()) {
res.action(ActionCode.ACTION_COMET_END, null);
}
return (!error);
} catch (Throwable t) {
if (!(t instanceof IOException)) {
log.error(sm.getString("coyoteAdapter.service"), t);
}
error = true;
try {
servlet.error(request.getRequest(), response.getResponse());
} catch (Throwable th) {
log.error(sm.getString("coyoteAdapter.service"), th);
}
return false;
} finally {