in activeio-core/src/main/java/org/apache/activeio/xnet/ServicePool.java [64:99]
public void service(final Socket socket) throws ServiceException, IOException {
final Runnable service = new Runnable() {
public void run() {
try {
next.service(socket);
} catch (SecurityException e) {
log.error("Security error: " + e.getMessage(), e);
} catch (Throwable e) {
log.error("Unexpected error", e);
} finally {
try {
if (socket != null) {
socket.close();
}
} catch (Throwable t) {
log.warn("Error while closing connection with client", t);
}
}
}
};
final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
Runnable ctxCL = new Runnable() {
public void run() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(tccl);
try {
service.run();
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
};
executor.execute(ctxCL);
}