if (proxy == null && isServletApiContext(type.getName())) {
proxy = createThreadLocalServletApiContext(type.getName());
}
if (proxy == null) {
ProxyClassLoader loader = new ProxyClassLoader(Proxy.class.getClassLoader());
loader.addLoader(type.getClassLoader());
loader.addLoader(ThreadLocalProxy.class.getClassLoader());
return (ThreadLocalProxy<T>)Proxy.newProxyInstance(loader,
new Class[] {type, ThreadLocalProxy.class },
new ThreadLocalInvocationHandler<T>());
}