当前位置: 首页>>代码示例>>Java>>正文


Java Axis2ConfigurationContextObserver类代码示例

本文整理汇总了Java中org.wso2.carbon.utils.Axis2ConfigurationContextObserver的典型用法代码示例。如果您正苦于以下问题:Java Axis2ConfigurationContextObserver类的具体用法?Java Axis2ConfigurationContextObserver怎么用?Java Axis2ConfigurationContextObserver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Axis2ConfigurationContextObserver类属于org.wso2.carbon.utils包,在下文中一共展示了Axis2ConfigurationContextObserver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
@SuppressWarnings("unused")
protected void activate(ComponentContext componentContext) {
    try {
        if (log.isDebugEnabled()) {
            log.debug("Initializing email sender core bundle");
        }
        /* Initializing email sender configuration */
        EmailSenderConfig.init();

        /* Setting up default email templates */
        EmailUtils.setupEmailTemplates();

        /* Registering declarative service instances exposed by EmailSenderServiceComponent */
        this.registerServices(componentContext);

        if (log.isDebugEnabled()) {
            log.debug("Email sender core bundle has been successfully initialized");
        }
        componentContext.getBundleContext().registerService(Axis2ConfigurationContextObserver.class.getName(),
                                                            new EmailSenderAxis2ConfigContextObserver(), null);
    } catch (Throwable e) {
        log.error("Error occurred while initializing email sender core bundle", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:25,代码来源:EmailSenderServiceComponent.java

示例2: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) {
    if (log.isDebugEnabled()) {
        log.debug("Carbon STS bundle is activated");
    }
    try {
        BundleContext bundleCtx = ctxt.getBundleContext();
        STSServiceDataHolder.getInstance().setBundle(bundleCtx.getBundle());
        // Publish the OSGi service
        Dictionary props = new Hashtable();
        props.put(CarbonConstants.AXIS2_CONFIG_SERVICE, AxisObserver.class.getName());
        ctxt.getBundleContext().registerService(AxisObserver.class.getName(),
                                                new STSDeploymentInterceptor(), props);

        // Publish an OSGi service to listen tenant configuration context creation events
        bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                                  new STSDeploymentListener(),
                                  null);
    } catch (Throwable e) {
        log.error("Error occurred while updating carbon STS service", e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:22,代码来源:STSServiceComponent.java

示例3: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) {
    try {
        ConfigurationContext mainConfigCtx = configContextService.getServerConfigContext();
        AxisConfiguration mainAxisConfig = mainConfigCtx.getAxisConfiguration();
        BundleContext bundleCtx = ctxt.getBundleContext();
        String enablePoxSecurity = ServerConfiguration.getInstance()
                .getFirstProperty("EnablePoxSecurity");
        if (enablePoxSecurity == null || "true".equals(enablePoxSecurity)) {
            mainAxisConfig.engageModule(POX_SECURITY_MODULE);
        } else {
            log.info("POX Security Disabled");
        }

        bundleCtx.registerService(SecurityConfigAdmin.class.getName(),
                new SecurityConfigAdmin(mainAxisConfig,
                        registryService.getConfigSystemRegistry(),
                        null),
                null);
        bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                new SecurityAxis2ConfigurationContextObserver(),
                null);
        log.debug("Security Mgt bundle is activated");
    } catch (Throwable e) {
        log.error("Failed to activate SecurityMgtServiceComponent", e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:27,代码来源:SecurityMgtServiceComponent.java

示例4: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) {
       registrations.push(ctxt.getBundleContext().registerService(
               RegistrySecurityService.class.getName(), new RegistrySecurityServiceImpl(), null));

       TenantDeploymentListenerImpl listener = new TenantDeploymentListenerImpl();
       registrations.push(ctxt.getBundleContext().registerService(
               Axis2ConfigurationContextObserver.class.getName(), listener, null));

       try {
           SecureVaultUtil.createRegistryResource(-1234);
       } catch (RegistryException ignore) {
       }
       if (log.isDebugEnabled()) {
		log.debug("Registry security component activated");
	}
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:17,代码来源:RegistrySecurityServiceComponent.java

示例5: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext componentContext) {
    try {
        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        carbonContext.setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
        carbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);

        ReportingAxis2ConfigurationContextObserver observer =
                new ReportingAxis2ConfigurationContextObserver();
        componentContext.getBundleContext().
                registerService(Axis2ConfigurationContextObserver.class.getName(), observer, null);
        CommonUtil.addJrxmlConfigs(registryServiceInstance.getSystemRegistry());
    } catch (Throwable e) {
        log.error(e.getMessage(), e);
    }

}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:17,代码来源:ReportingComponent.java

示例6: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) {
    try {
        // Engaging StatisticModule as an global module
        configContext.getAxisConfiguration().engageModule(StatisticsConstants.STATISTISTICS_MODULE_NAME);

        //Register Statistics MBean
        registerMBeans(serverConfig);
        //Registering StatisticsAdmin as an OSGi service.
        BundleContext bundleCtx = ctxt.getBundleContext();
        statAdminServiceRegistration = bundleCtx.registerService(SystemStatisticsUtil.class.getName(),
                new SystemStatisticsUtil(), null);
        axisConfigCtxObserverServiceRegistration =
                bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                        new StatisticsAxis2ConfigurationContextObserver(), null);
        log.debug("Statistics bundle is activated");
    } catch (Throwable e) {
        log.error("Failed to activate Statistics bundle", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:20,代码来源:StatisticsServiceComponent.java

示例7: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) throws TransactionManagerException {
    BundleContext bundleContext = ctxt.getBundleContext();
    bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(),
            new TransactionManagerAxis2ConfigurationContextObserver(), null);

    //Register transaction-manager with JNDI for all available tenants.
    List<Integer> tenants = this.getAllTenantIds();
    for (int tid : tenants) {
        bindTransactionManagerWithJNDIForTenant(tid);
    }
    if (log.isDebugEnabled()) {
        log.debug("Transaction Manager bundle is activated ");
    }
    bundleContext.registerService(TransactionManagerDummyService.class.getName(),
            new TransactionManagerDummyService(), null);
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:17,代码来源:TransactionManagerComponent.java

示例8: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) {
    BundleContext bundleCtx = ctxt.getBundleContext();

    // Publish the OSGi service
    Dictionary props = new Hashtable();
    props.put(CarbonConstants.AXIS2_CONFIG_SERVICE, AxisObserver.class.getName());
    bundleCtx.registerService(AxisObserver.class.getName(), this, props);

    PreAxisConfigurationPopulationObserver preAxisConfigObserver =
            new PreAxisConfigurationPopulationObserver() {
                public void createdAxisConfiguration(AxisConfiguration axisConfiguration) {
                    init(axisConfiguration);
                    axisConfiguration.addObservers(UrlMappingDeploymentInterceptor.this);
                }
            };
    bundleCtx.registerService(PreAxisConfigurationPopulationObserver.class.getName(),
            preAxisConfigObserver, null);

    // Publish an OSGi service to listen tenant configuration context creation events
    Dictionary properties = new Hashtable();
    properties.put(CarbonConstants.AXIS2_CONFIG_SERVICE,
            Axis2ConfigurationContextObserver.class.getName());
    bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                new UrlMappingServiceListener(), properties);
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:26,代码来源:UrlMappingDeploymentInterceptor.java

示例9: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext ctxt) {
    try {
        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        carbonContext.setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
        carbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);

        bundleContext = ctxt.getBundleContext();

        //Save the template policies in the registry.
        saveTemplatePolicies(bundleContext);

        axisConfigContextObserverServiceReg = bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(),
                                              new ThrottlingAxis2ConfigurationContextObserver(),
                                              null);
        log.debug("Throttle bundle is activated");
    } catch (Throwable e) {
        log.error("Failed to activate Throttle bundle", e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-qos,代码行数:20,代码来源:ThrottleServiceComponent.java

示例10: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext componentContext) {
    BundleContext bundleCtx = componentContext.getBundleContext();
    RxtLoader rxtLoader = new RxtLoader();
    CommonUtil.loadDependencyGraphMaxDepthConfig();
    ServiceRegistration tenantMgtListenerSR = bundleCtx.registerService(
            Axis2ConfigurationContextObserver.class.getName(), rxtLoader, null);
    if (tenantMgtListenerSR != null) {
        log.debug("Identity Provider Management - RXTLoader registered");
    } else {
        log.error("Identity Provider Management - RXTLoader could not be registered");
    }

    if (log.isDebugEnabled()) {
        log.debug("GovernanceRegistryExtensionsComponent activated");
    }
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:17,代码来源:GovernanceRegistryExtensionsComponent.java

示例11: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
@Activate
protected void activate(ComponentContext ctxt) {
    try {
        ConfigurationContext mainConfigCtx = configContextService.getServerConfigContext();
        AxisConfiguration mainAxisConfig = mainConfigCtx.getAxisConfiguration();
        BundleContext bundleCtx = ctxt.getBundleContext();
        String enablePoxSecurity = ServerConfiguration.getInstance()
                .getFirstProperty("EnablePoxSecurity");
        if (enablePoxSecurity == null || "true".equals(enablePoxSecurity)) {
            mainAxisConfig.engageModule(POX_SECURITY_MODULE);
        } else {
            log.info("POX Security Disabled");
        }

        bundleCtx.registerService(SecurityConfigAdmin.class.getName(),
                new SecurityConfigAdmin(mainAxisConfig,
                        registryService.getConfigSystemRegistry(),
                        null),
                null);
        bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                new SecurityAxis2ConfigurationContextObserver(),
                null);
        log.debug("Security Mgt bundle is activated");
    } catch (Throwable e) {
        log.error("Failed to activate SecurityMgtServiceComponent", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:SecurityMgtServiceComponent.java

示例12: initialize

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
/**
 * @throws Exception
 */
private void initialize() throws Exception {

    // Register a Axis2ConfigurationContextObserver to activate on loading tenants.
    bundleContext.registerService(
            Axis2ConfigurationContextObserver.class.getName(), new STSConfigurationContextObserver(), null);
    log.debug("Registered STSConfigurationContextObserver to configure STS service for tenants.");

    loadSecurityScenarios();
    STSConfigAdmin.configureService(configContext.getAxisConfiguration(),
                                    this.registryService.getConfigSystemRegistry());
    STSConfigAdmin.configureGenericSTS();
    configContext.getAxisConfiguration().addObservers(new STSObserver());
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:17,代码来源:IdentitySTSMgtServiceComponent.java

示例13: activate

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
protected void activate(ComponentContext context) {
    registrations.push(context.getBundleContext().registerService(
            ContentSearchService.class.getName(), new ContentSearchServiceImpl(), null));
    registrations.push(context.getBundleContext().registerService(
            AttributeSearchService.class.getName(), new AttributeSearchServiceImpl(), null));
    registrations.push(context.getBundleContext().registerService(
            TermsSearchService.class.getName(), new TermsSearchServiceImpl(), null));
    registrations.push(context.getBundleContext().registerService(
            TermsQuerySearchService.class.getName(), new TermsQuerySearchServiceImpl(), null));
    registrations.push(context.getBundleContext().registerService(
            WaitBeforeShutdownObserver.class.getName(), new WaitBeforeShutdownObserver() {
        boolean status = false;
        public void startingShutdown() {
            try {
                IndexingManager.getInstance().stopIndexing();
            } finally {
               status = true;
            }
        }

        public boolean isTaskComplete() {
            return status;
        }
    }, null));
    TenantDeploymentListenerImpl listener = new TenantDeploymentListenerImpl();
    registrations.push(context.getBundleContext().registerService(
            Axis2ConfigurationContextObserver.class.getName(), listener, null));
    registrations.push(context.getBundleContext().registerService(
            TenantIndexingLoader.class.getName(), listener, null));
    try {
        if (Utils.isIndexingConfigAvailable()) {
            IndexingManager.getInstance().startIndexing();
        } else {
            log.debug("<indexingConfiguration/> not available in registry.xml to start the resource indexing task");
        }
    } catch (RegistryException e) {
        log.error("Failed to start resource indexing task");
    }
    log.debug("Registry Indexing bundle is activated");
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:41,代码来源:IndexingServiceComponent.java

示例14: startEventBroker

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
public void startEventBroker() {
     try {
         // set incarnate this thread to supper tenat since carbon contexes can only be
         // run is supertenants
         PrivilegedCarbonContext.startTenantFlow();
         PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
         PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
         PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(CarbonConstants.REGISTRY_SYSTEM_USERNAME);

         EventBroker eventBroker = EventBrokerBuilder.createEventBroker();
         this.eventServiceRegistration =
                 this.context.getBundleContext().registerService(EventBroker.class.getName(), eventBroker, null);

         // register the tenat login listener
         EventAxis2ConfigurationContextObserver observer = new EventAxis2ConfigurationContextObserver();
         observer.setEventBroker(eventBroker);

         this.context.getBundleContext().registerService(
                 Axis2ConfigurationContextObserver.class.getName(), observer, null);
         if(log.isDebugEnabled()){ 
	log.info("Successfully registered the event broker");
}
     } catch (EventBrokerConfigurationException e) {
         log.error("Can not create the event broker", e);
     } finally {
         PrivilegedCarbonContext.endTenantFlow();
     }
 }
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:29,代码来源:EventBrokerHandler.java

示例15: startEventBroker

import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; //导入依赖的package包/类
/**
  * Start event broker
  */
 public void startEventBroker() {
     try {
         // set incarnate this thread to supper tenant since carbon context can only be
         // run is super tenants
         PrivilegedCarbonContext.startTenantFlow();
         PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
         PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
         PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(CarbonConstants.REGISTRY_SYSTEM_USERNAME);

         EventBroker eventBroker = EventBrokerBuilder.createEventBroker();
         this.eventServiceRegistration =
                 this.context.getBundleContext().registerService(EventBroker.class.getName(), eventBroker, null);

         // register the tenat login listener
         EventAxis2ConfigurationContextObserver observer = new EventAxis2ConfigurationContextObserver();
         observer.setEventBroker(eventBroker);

         this.context.getBundleContext().registerService(
                 Axis2ConfigurationContextObserver.class.getName(), observer, null);
         if(log.isDebugEnabled()){ 
	log.info("Successfully registered the event broker");
}
     } catch (EventBrokerConfigurationException e) {
         log.error("Can not create the event broker", e);
     } finally {
         PrivilegedCarbonContext.endTenantFlow();
     }
 }
 
开发者ID:wso2,项目名称:carbon-business-messaging,代码行数:32,代码来源:EventBrokerHandler.java


注:本文中的org.wso2.carbon.utils.Axis2ConfigurationContextObserver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。