
nl.talsmasoftware.context.servletrequest.ServletRequestContextManager Maven / Gradle / Ivy
The newest version!
package nl.talsmasoftware.context.servletrequest;
import nl.talsmasoftware.context.Context;
import nl.talsmasoftware.context.ContextManager;
import javax.servlet.ServletRequest;
/**
* Manager to propagate a current {@link ServletRequest} with.
*
* @author Sjoerd Talsma
*/
public final class ServletRequestContextManager implements ContextManager {
public Context initializeNewContext(ServletRequest value) {
return new ServletRequestContext(value);
}
public Context getActiveContext() {
return ServletRequestContext.current();
}
/**
* Unconditionally removes the active context (and any parents).
*
* This is useful for boundary filters, whose Threads may be returned to some threadpool.
*/
public static void clear() {
ServletRequestContext.clear();
}
public String toString() {
return "ServletRequestContextManager";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy