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


Java AxisConfiguration.engageModule方法代码示例

本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration.engageModule方法的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration.engageModule方法的具体用法?Java AxisConfiguration.engageModule怎么用?Java AxisConfiguration.engageModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.engine.AxisConfiguration的用法示例。


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

示例1: activate

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的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

示例2: getClientCfgCtx

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public ConfigurationContext getClientCfgCtx() throws Exception {
    ConfigurationContext cfgCtx =
        ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
    AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
    axisCfg.engageModule("addressing");

    TransportInDescription trpInDesc = new TransportInDescription("udp");
    trpInDesc.setReceiver(new UDPListener());
    axisCfg.addTransportIn(trpInDesc);
    
    TransportOutDescription trpOutDesc = new TransportOutDescription("udp");
    trpOutDesc.setSender(new UDPSender());
    axisCfg.addTransportOut(trpOutDesc);
    
    return cfgCtx;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:17,代码来源:UDPTest.java

示例3: createdConfigurationContext

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:22,代码来源:StatisticsAxis2ConfigurationContextObserver.java

示例4: createdConfigurationContext

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
@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);
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:SecurityAxis2ConfigurationContextObserver.java

示例5: activate

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的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

示例6: setMonitoring

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
 * @param flag; support ON or OFF.
 * @return The information about the Tracer service
 * @throws AxisFault If the tracer module is not found
 */
public TracerServiceInfo setMonitoring(String flag) throws AxisFault {
    if (!flag.equalsIgnoreCase("ON") && !flag.equalsIgnoreCase("OFF")) {
        throw new RuntimeException("IllegalArgument for monitoring status. Only 'ON' and 'OFF' is allowed");
    }
    TracerServiceInfo tracerServiceInfo = new TracerServiceInfo();
    ConfigurationContext configurationContext = getConfigContext();
    AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
    AxisModule axisModule = axisConfiguration.getModule(TracerConstants.WSO2_TRACER);

    if (axisModule == null) {
        throw new RuntimeException(TracerAdmin.class.getName() + " " +
                                   TracerConstants.WSO2_TRACER + " is not available");
    }

    if (flag.equalsIgnoreCase("ON")) {
        if (!axisConfiguration.isEngaged(axisModule.getName())) {
            try {
                axisConfiguration.engageModule(axisModule);
            } catch (AxisFault axisFault) {
                log.error(axisFault);
                throw new RuntimeException(axisFault);
            }
        }
    } else if (flag.equalsIgnoreCase("OFF")) {
        if (axisConfiguration.isEngaged(axisModule.getName())) {
            axisConfiguration.disengageModule(axisModule);
            configurationContext.removeProperty(TracerConstants.MSG_SEQ_BUFFER);
        }
    }
    TracePersister tracePersister = getTracePersister();
    tracePersister.saveTraceStatus(flag);
    tracerServiceInfo.setEmpty(true);
    tracerServiceInfo.setFlag(flag);
    tracerServiceInfo.setTracePersister(tracePersister.getClass().getName());

    return tracerServiceInfo;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:43,代码来源:TracerAdmin.java

示例7: testCalculateDefaultModuleVersions

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testCalculateDefaultModuleVersions() throws AxisFault {
    AxisConfiguration axisConfiguration = new AxisConfiguration();
    AxisModule module1 = new AxisModule();
    module1.setArchiveName("Module1");
    axisConfiguration.addModule(module1);

    AxisModule module2 = new AxisModule();
    module2.setArchiveName("Module2-0.94");
    axisConfiguration.addModule(module2);

    AxisModule module3 = new AxisModule();
    module3.setArchiveName("Module2-0.95");
    axisConfiguration.addModule(module3);

    AxisModule module4 = new AxisModule();
    module4.setArchiveName("Module2-0.93");
    axisConfiguration.addModule(module4);

    AxisModule module5 = new AxisModule();
    module5.setArchiveName("testModule-1.93");
    axisConfiguration.addModule(module5);

    Utils.calculateDefaultModuleVersion(axisConfiguration.getModules(), axisConfiguration);
    assertEquals(module1, axisConfiguration.getDefaultModule("Module1"));
    assertEquals(module3, axisConfiguration.getDefaultModule("Module2"));
    assertEquals(module5, axisConfiguration.getDefaultModule("testModule"));
    axisConfiguration.engageModule("Module2");
    axisConfiguration.engageModule("Module1");
    axisConfiguration.engageModule("testModule", "1.93");

    Iterator engageModules = axisConfiguration.getEngagedModules().iterator();
    boolean found1 = false;
    boolean found2 = false;
    boolean found3 = false;
    while (engageModules.hasNext()) {
        String name = ((AxisModule)engageModules.next()).getArchiveName();
        if (name.equals("Module2-0.95")) {
            found1 = true;
        }
        if (name.equals("Module1")) {
            found2 = true;
        }
        if (name.equals("testModule-1.93")) {
            found3 = true;
        }
    }

    if (!found1) {
        fail("Didn't find Module2-0.95");
    }
    if (!found2) {
        fail("Didn't find Module1");
    }
    if (!found3) {
        fail("Didn't find testModule-1.93");
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:58,代码来源:ModuleversionTest.java


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