com.deepexi.devops.proxy.util.ThreadLocalUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http-proxy-servlet Show documentation
Show all versions of http-proxy-servlet Show documentation
Supports servlets for http and https request proxy
The newest version!
package com.deepexi.devops.proxy.util;
import com.deepexi.devops.proxy.RequestContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author taccisum - [email protected]
* @since 2019-11-13
*/
public abstract class ThreadLocalUtils {
private static ThreadLocal context = new ThreadLocal<>();
public static RequestContext getRequestContext(HttpServletRequest request, HttpServletResponse response) {
if (context.get() == null) {
context.set(new RequestContext(request, response));
}
return context.get();
}
public static void clearRequestContext() {
context.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy