/** * Engage all the previously added global modules. * * @throws AxisFault if an individual engageModule() fails */ public void engageGlobalModules() throws AxisFault { for (String aGlobalModuleList : globalModuleList) { engageModule(aGlobalModuleList); } }
/** * Engage all the previously added global modules. * * @throws AxisFault if an individual engageModule() fails */ public void engageGlobalModules() throws AxisFault { for (String aGlobalModuleList : globalModuleList) { engageModule(aGlobalModuleList); } }
public void enableAddressing() throws AxisFault { cfgCtx.getAxisConfiguration().engageModule("addressing"); }
public void enableAddressing() throws AxisFault { cfgCtx.getAxisConfiguration().engageModule("addressing"); }
public void enableAddressing() throws AxisFault { cfgCtx.getAxisConfiguration().engageModule("addressing"); }
@Override public void createdConfigurationContext(ConfigurationContext configurationContext) { AxisConfiguration axisConfig = configurationContext.getAxisConfiguration(); AxisModule poxSecModule = axisConfig.getModule("POXSecurityModule"); if (poxSecModule != null) { try { axisConfig.engageModule(poxSecModule); } catch (AxisFault e) { log.error("Cannot globally engage POX Security module", e); } } }
@Override public void createdConfigurationContext(ConfigurationContext configurationContext) { AxisConfiguration axisConfig = configurationContext.getAxisConfiguration(); AxisModule poxSecModule = axisConfig.getModule("POXSecurityModule"); if (poxSecModule != null) { try { axisConfig.engageModule(poxSecModule); } catch (AxisFault e) { log.error("Cannot globally engage POX Security module", e); } } }
@Override public void createdConfigurationContext(ConfigurationContext configurationContext) { AxisConfiguration axisConfig = configurationContext.getAxisConfiguration(); AxisModule poxSecModule = axisConfig.getModule("POXSecurityModule"); if (poxSecModule != null) { try { axisConfig.engageModule(poxSecModule); } catch (AxisFault e) { log.error("Cannot globally engage POX Security module", e); } } }
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); } }
/** * Engages the default module version corresponding to given module name , * or if the module name contains version number in it then it will engage * the correct module. Both of the below two cases are valid 1. * engageModule("addressing"); 2. engageModule("addressing-1.23"); * * @param moduleref name of module to engage * @throws AxisFault */ public void engageModule(String moduleref) throws AxisFault { AxisModule module = getModule(moduleref); if (module != null) { engageModule(module); } else { throw new AxisFault(Messages.getMessage("modulenotavailble", moduleref)); } }
/** * Engages the default module version corresponding to given module name , * or if the module name contains version number in it then it will engage * the correct module. Both of the below two cases are valid 1. * engageModule("addressing"); 2. engageModule("addressing-1.23"); * * @param moduleref name of module to engage * @throws AxisFault */ public void engageModule(String moduleref) throws AxisFault { AxisModule module = getModule(moduleref); if (module != null) { engageModule(module); } else { throw new AxisFault(Messages.getMessage("modulenotavailble", moduleref)); } }
@Override public void createdConfigurationContext(ConfigurationContext configContext) { AxisConfiguration axisConfiguration = configContext.getAxisConfiguration(); int tenantId = PrivilegedCarbonContext.getCurrentContext().getTenantId(false); try { axisConfiguration.engageModule("metering"); } catch (AxisFault axisFault) { log.error("Could not engage metering module for tenant: " + tenantId, axisFault); } }
@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); } }
@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); } }
/** * Engages a module using given name and its version ID. * * @param moduleName name of module to engage * @param versionID version of module to engage * @throws AxisFault */ public void engageModule(String moduleName, String versionID) throws AxisFault { String actualName = Utils.getModuleName(moduleName, versionID); AxisModule module = getModule(actualName); if (module != null) { engageModule(module); } else { // TODO : Should this be an NPE or InvalidArgumentException? throw new AxisFault(Messages.getMessage("refertoinvalidmodule")); } }
/** * Engages a module using given name and its version ID. * * @param moduleName name of module to engage * @param versionID version of module to engage * @throws AxisFault */ public void engageModule(String moduleName, String versionID) throws AxisFault { String actualName = Utils.getModuleName(moduleName, versionID); AxisModule module = getModule(actualName); if (module != null) { engageModule(module); } else { // TODO : Should this be an NPE or InvalidArgumentException? throw new AxisFault(Messages.getMessage("refertoinvalidmodule")); } }
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); } }
public void createdConfigurationContext(ConfigurationContext configContext) { AxisConfiguration axisConfiguration = configContext.getAxisConfiguration(); AxisModule serviceStatisticsModule = axisConfiguration .getModule(ServiceStatisticsPublisherConstants.BAM_SERVICE_STATISTISTICS_PUBLISHER_MODULE_NAME); int tenantId = SuperTenantCarbonContext.getCurrentContext(axisConfiguration).getTenantId(); if (serviceStatisticsModule != null) { try { axisConfiguration .engageModule(ServiceStatisticsPublisherConstants.BAM_SERVICE_STATISTISTICS_PUBLISHER_MODULE_NAME); } catch (AxisFault e) { log.error("Cannot engage ServiceStatistics module for teh tenant :" + tenantId, e); } } }
public void createdConfigurationContext(ConfigurationContext configurationContext) { AxisConfiguration axisConfig = configurationContext.getAxisConfiguration(); try { if (axisConfig.getModule(StatisticsConstants.STATISTISTICS_MODULE_NAME) != null) { axisConfig.engageModule(StatisticsConstants.STATISTISTICS_MODULE_NAME); } } catch (Throwable e) { PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); String msg; if (carbonContext.getTenantDomain() != null) { msg = "Could not globally engage " + StatisticsConstants.STATISTISTICS_MODULE_NAME + " module to tenant " + carbonContext.getTenantDomain() + "[" + carbonContext.getTenantId() + "]"; } else { msg = "Could not globally engage " + StatisticsConstants.STATISTISTICS_MODULE_NAME + " module to super tenant "; } log.error(msg, e); } }
public void configureBinding(Object context) { ConfigurationContext configContext = ((Axis2BaseBindingProvider)context).getAxisConfigurationContext(); for ( Object policy : findPolicies() ) { if ( policy instanceof WSPolicy ) { WSPolicy wsPolicy = (WSPolicy)policy; try { configContext.getAxisConfiguration().applyPolicy(wsPolicy.getNeethiPolicy()); configContext.getAxisConfiguration().engageModule("rampart"); // TUSCANY-2824 // hack to make service side pick up rampart policies // "rampartPolicy" comes from RampartMessageData.KEY_RAMPART_POLICY // but I'm avoiding adding an explicit dependency just yet. // There must be a proper way of getting rampart to recognize // these policies configContext.setProperty("rampartPolicy", wsPolicy.getNeethiPolicy()); } catch ( AxisFault e ) { throw new RuntimeException(e); } } } } }