org.tkit.quarkus.context.RequestDataContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tkit-quarkus-context Show documentation
Show all versions of tkit-quarkus-context Show documentation
1000kit Quarkus Context extension
The newest version!
package org.tkit.quarkus.context;
public class RequestDataContext {
private static ThreadLocal requestDataThreadLocal = new ThreadLocal<>();
public static RequestData get() {
if (requestDataThreadLocal != null) {
return requestDataThreadLocal.get();
}
return null;
}
public static void set(RequestData data) {
requestDataThreadLocal.set(data);
}
public static void clear() {
if (get() != null) {
requestDataThreadLocal.remove();
}
}
}