in invoker/core/src/main/java/com/google/cloud/functions/invoker/TypedFunctionExecutor.java [97:109]
public void service(HttpServletRequest req, HttpServletResponse res) {
HttpRequestImpl reqImpl = new HttpRequestImpl(req);
HttpResponseImpl resImpl = new HttpResponseImpl(res);
ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(function.getClass().getClassLoader());
handleRequest(reqImpl, resImpl);
} finally {
Thread.currentThread().setContextClassLoader(oldContextClassLoader);
resImpl.flush();
}
}