Exemplo n.º 1
0
 /**
  * Terminate the provided Tenant ConfigurationContext
  *
  * @param tenantCfgCtx The tenant ConfigurationContext which needs to be terminated
  */
 public static void terminateTenantConfigContext(ConfigurationContext tenantCfgCtx) {
   ConfigurationContext mainServerConfigContext =
       CarbonCoreDataHolder.getInstance().getMainServerConfigContext();
   Map<String, ConfigurationContext> tenantConfigContexts =
       getTenantConfigurationContexts(mainServerConfigContext);
   String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
   log.info("Starting to clean tenant : " + tenantDomain);
   tenantCfgCtx.getAxisConfiguration().getConfigurator().cleanup();
   try {
     doPreConfigContextTermination(tenantCfgCtx);
     tenantCfgCtx.terminate();
     doPostConfigContextTermination(tenantCfgCtx);
     tenantConfigContexts.remove(tenantDomain);
     log.info("Cleaned up tenant " + tenantDomain);
   } catch (AxisFault e) {
     log.error("Cannot cleanup ConfigurationContext of tenant " + tenantDomain, e);
   }
 }