private int ownerTenantId;
private CacheManagerFactoryImpl cacheManagerFactory;
public HazelcastCacheManager(String name, CacheManagerFactoryImpl cacheManagerFactory) {
this.cacheManagerFactory = cacheManagerFactory;
CarbonContext carbonContext = CarbonContext.getThreadLocalCarbonContext();
if (carbonContext == null) {
throw new IllegalStateException("CarbonContext cannot be null");
}
ownerTenantDomain = carbonContext.getTenantDomain();
if (ownerTenantDomain == null) {
throw new IllegalStateException("Tenant domain cannot be " + ownerTenantDomain);
}
ownerTenantId = carbonContext.getTenantId();
if (ownerTenantId == MultitenantConstants.INVALID_TENANT_ID) {
throw new IllegalStateException("Tenant ID cannot be " + ownerTenantId);
}
this.name = name;
status = Status.STARTED;