com.techsophy.multitenancy.mongo.config.TenantContext Maven / Gradle / Ivy
package com.techsophy.multitenancy.mongo.config;
import org.springframework.context.annotation.Configuration;
@Configuration
public class TenantContext {
private static final ThreadLocal CONTEXT = new ThreadLocal<>();
public static void setTenantId(String tenantId) {
CONTEXT.set(tenantId);
}
public static String getTenantId() {
return CONTEXT.get();
}
public static void clear() {
CONTEXT.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy