package com.qianwen.core.tenant;
|
|
import org.springframework.core.NamedThreadLocal;
|
|
public class BladeTenantHolder {
|
private static final ThreadLocal<Boolean> TENANT_KEY_HOLDER = new NamedThreadLocal<Boolean>("blade-tenant"){
|
|
protected Boolean initialValue(){
|
return Boolean.FALSE;
|
}
|
};
|
|
|
public static void setIgnore(Boolean ignore) {
|
TENANT_KEY_HOLDER.set(ignore);
|
}
|
|
public static Boolean isIgnore() {
|
return TENANT_KEY_HOLDER.get();
|
}
|
|
public static void clear() {
|
TENANT_KEY_HOLDER.remove();
|
}
|
}
|