private static Log log = LogFactory.getLog(AbstractAdmin.class);
protected ConfigurationContext getConfigContext() {
// If a tenant has been set, then try to get the ConfigurationContext of that tenant
PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
ConfigurationContextService configurationContextService =
(ConfigurationContextService) carbonContext.getOSGiService(ConfigurationContextService.class);
ConfigurationContext mainConfigContext = configurationContextService.getServerConfigContext();
String domain = carbonContext.getTenantDomain();
if (domain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(domain)) {
return TenantAxisUtils.getTenantConfigurationContext(domain, mainConfigContext);
} else if (carbonContext.getTenantId() == MultitenantConstants.SUPER_TENANT_ID) {
return mainConfigContext;
} else {
throw new UnsupportedOperationException("Tenant domain unidentified. " +
"Upstream code needs to identify & set the tenant domain & tenant ID. " +
" The TenantDomain SOAP header could be set by the clients or " +