protected void activate(ComponentContext ctx) {
    try {
      // Register the valves with Tomcat
      ArrayList<CarbonTomcatValve> valves = new ArrayList<CarbonTomcatValve>();
      valves.add(new TenantLazyLoaderValve());
      if (GhostDeployerUtils.isGhostOn()) {
        valves.add(new GhostWebappDeployerValve());
        // registering WebappUnloader as an OSGi service
        WebappUnloader webappUnloader = new WebappUnloader();
        ctx.getBundleContext()
            .registerService(ArtifactUnloader.class.getName(), webappUnloader, null);
        GhostWebappMetaArtifactsLoader artifactsLoader = new GhostWebappMetaArtifactsLoader();
        ctx.getBundleContext()
            .registerService(GhostMetaArtifactsLoader.class.getName(), artifactsLoader, null);

      } else {
        setServerURLParam(DataHolder.getServerConfigContext());
      }
      // adding TenantLazyLoaderValve first in the TomcatContainer if Url mapping available
      if (DataHolder.getHotUpdateService() != null
      //                && TomcatValveContainer.isValveExists(new UrlMapperValve //TODO: Fix this
      // once URLMapper component becomes available
      ) {
        TomcatValveContainer.addValves(WebappsConstants.VALVE_INDEX, valves);
      } else {
        TomcatValveContainer.addValves(valves);
      }

    } catch (Throwable e) {
      log.error("Error occurred while activating WebappManagementServiceComponent", e);
    }
  }
 protected void setAppManager(ApplicationManagerService applicationManager) {
   this.applicationManager = applicationManager;
   DataHolder.setApplicationManager(applicationManager);
 }
 protected void unsetDeploymentSynchronizerService(DeploymentSynchronizer depSynchService) {
   DataHolder.setDeploymentSynchronizerService(null);
 }
 protected void setTenantRegistryLoader(TenantRegistryLoader tenantRegistryLoader) {
   DataHolder.setTenantRegistryLoader(tenantRegistryLoader);
 }
 protected void setRealmService(RealmService realmService) {
   // keeping the realm service in the DataHolder class
   DataHolder.setRealmService(realmService);
 }
 protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
   DataHolder.setServerConfigContext(null);
 }
 protected void setConfigurationContextService(ConfigurationContextService contextService) {
   DataHolder.setServerConfigContext(contextService.getServerConfigContext());
 }