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


Java AxisConfiguration.getModule方法代码示例

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


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

示例1: testModuleLoading

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testModuleLoading() throws Exception {
    String repoRoot = AbstractTestCase.basedir + "/test-resources/deployment/repositories/moduleLoadTest";
    AxisConfiguration ac =
            ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoRoot , repoRoot + "/axis2.xml")
                    .getAxisConfiguration();

    // Make sure we got the exploded module in the repo/modules dir
    AxisModule module = ac.getModule("explodedModule");
    assertNotNull(module);
    String val = (String)module.getParameter("color").getValue();
    assertEquals("green", val);

    // Make sure we got the module that's outside the repo, but in the classpath
    module = ac.getModule("classpathModule");
    assertNotNull("Didn't find classpath module!", module);
    val = (String)module.getParameter("color").getValue();
    assertEquals("Parameter wasn't set correctly", "blue", val);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:ModuleLoadingTest.java

示例2: 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

示例3: 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

示例4: processdisengageModule

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void processdisengageModule(HttpServletRequest req, HttpServletResponse res)
        throws IOException, ServletException {
    String type = req.getParameter("type");
    String serviceName = req.getParameter("serviceName");
    String moduleName = req.getParameter("module");
    AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
    AxisService service = axisConfiguration.getService(serviceName);
    AxisModule module = axisConfiguration.getModule(moduleName);
    if (type.equals("operation")) {
        if (service.isEngaged(module.getName()) ||
                axisConfiguration.isEngaged(module.getName())) {
            req.getSession().setAttribute("status", "Can not disengage module " + moduleName +
                    ". This module is engaged at a higher level.");
        } else {
            String opName = req.getParameter("operation");
            AxisOperation op = service.getOperation(new QName(opName));
            op.disengageModule(module);
            req.getSession()
                    .setAttribute("status", "Module " + moduleName + " was disengaged from " +
                            "operation " + opName + " in service " + serviceName + ".");
        }
    } else {
        if (axisConfiguration.isEngaged(module.getName())) {
            req.getSession()
                    .setAttribute("status", "Can not disengage module " + moduleName + ". " +
                            "This module is engaged at a higher level.");
        } else {
            service.disengageModule(axisConfiguration.getModule(moduleName));
            req.getSession()
                    .setAttribute("status", "Module " + moduleName + " was disengaged from" +
                            " service " + serviceName + ".");
        }
    }
    renderView("disengage.jsp", req, res);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:AdminAgent.java

示例5: testModuleDisableAddressingForOutMessagesTrue

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testModuleDisableAddressingForOutMessagesTrue() throws Exception {
    File configFile = new File(System.getProperty("basedir",".") + 
            "/test-resources/axis2-noParameters.xml");
    ConfigurationContext cfgCtx = ConfigurationContextFactory
    .createConfigurationContextFromFileSystem("target/test-classes",
            configFile.getAbsolutePath());
    AxisConfiguration config = cfgCtx.getAxisConfiguration();
    
    // Can't test with a module.xml file in test-resources because it gets
    // overridden by target\classes\META-INF\module.xml, so create our own
    // AxisModule with the required parameter value
    AxisModule module = config.getModule("addressing");
    module.addParameter(new Parameter("disableAddressingForOutMessages", "true"));
    
    msgCtxt = cfgCtx.createMessageContext();
    
    // Need to add a SOAP Header to stop this error from XMLComparator:
    // "There is no Header element under Envelope"
    SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
    SOAPHeaderBlock soapHeaderBlock = envelope.getHeader().addHeaderBlock(
            "testHeader", new OMNamespaceImpl("http://test.com", "test"));
    msgCtxt.setEnvelope(envelope);
    
    outHandler.invoke(msgCtxt);

    XMLUnit.setIgnoreWhitespace(true);
    assertXMLEqual(msgCtxt.getEnvelope().toString(), TestUtil
            .getOMBuilder("addressingDisabledTest.xml")
            .getDocumentElement().toString());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:AddressingOutHandlerTest.java

示例6: testModuleDisableAddressingForOutMessagesFalse

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testModuleDisableAddressingForOutMessagesFalse() throws Exception {
    File configFile = new File(System.getProperty("basedir",".") + 
            "/test-resources/axis2-noParameters.xml");
    ConfigurationContext cfgCtx = ConfigurationContextFactory
    .createConfigurationContextFromFileSystem("target/test-classes",
            configFile.getAbsolutePath());
    AxisConfiguration config = cfgCtx.getAxisConfiguration();

    // Can't test with a module.xml file in test-resources because it gets
    // overridden by target\classes\META-INF\module.xml, so create our own
    // AxisModule with the required parameter value
    AxisModule module = config.getModule("addressing");
    module.addParameter(new Parameter("disableAddressingForOutMessages", "false"));
    
    msgCtxt = cfgCtx.createMessageContext();
    msgCtxt.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
    msgCtxt.setTo(new EndpointReference("http://www.to.org/service/"));
    msgCtxt.setFrom(new EndpointReference("http://www.from.org/service/"));
    msgCtxt.setReplyTo(new EndpointReference("http://www.replyTo.org/service/"));
    msgCtxt.setFaultTo(new EndpointReference("http://www.faultTo.org/service/"));
    msgCtxt.setWSAAction("http://www.actions.org/action");
    msgCtxt.setMessageID("123456-7890");
    msgCtxt.addRelatesTo(new RelatesTo("http://www.relatesTo.org/service/"));
    msgCtxt.setProperty(WS_ADDRESSING_VERSION, Final.WSA_NAMESPACE);
    
    outHandler.invoke(msgCtxt);

    XMLUnit.setIgnoreWhitespace(true);
    assertXMLEqual(msgCtxt.getEnvelope().toString(), TestUtil
            .getOMBuilder("addressingEnabledTest.xml")
            .getDocumentElement().toString());   
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:33,代码来源:AddressingOutHandlerTest.java

示例7: testModuleIncludeOptionalHeadersTrue

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testModuleIncludeOptionalHeadersTrue() throws Exception {
    File configFile = new File(System.getProperty("basedir",".") + 
            "/test-resources/axis2-noParameters.xml");
    ConfigurationContext cfgCtx = ConfigurationContextFactory
    .createConfigurationContextFromFileSystem("target/test-classes",
            configFile.getAbsolutePath());
    AxisConfiguration config = cfgCtx.getAxisConfiguration();

    // Can't test with a module.xml file in test-resources because it gets
    // overridden by target\classes\META-INF\module.xml, so create our own
    // AxisModule with the required parameter value
    AxisModule module = config.getModule("addressing");
    module.addParameter(new Parameter("includeOptionalHeaders", "true"));

    msgCtxt = cfgCtx.createMessageContext();
    msgCtxt.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
    msgCtxt.setTo(new EndpointReference("http://www.to.org/service/"));
    msgCtxt.setFrom(new EndpointReference("http://www.from.org/service/"));
    msgCtxt.setReplyTo(new EndpointReference("http://www.replyTo.org/service/"));
    msgCtxt.setFaultTo(new EndpointReference("http://www.faultTo.org/service/"));
    msgCtxt.setWSAAction("http://www.actions.org/action");
    msgCtxt.setMessageID("123456-7890");
    msgCtxt.addRelatesTo(new RelatesTo("http://www.relatesTo.org/service/"));
    msgCtxt.setProperty(WS_ADDRESSING_VERSION, Final.WSA_NAMESPACE);
    
    outHandler.invoke(msgCtxt);

    XMLUnit.setIgnoreWhitespace(true);
    assertXMLEqual(msgCtxt.getEnvelope().toString(), TestUtil
            .getOMBuilder("withOptionalHeadersTest.xml")
            .getDocumentElement().toString());   
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:33,代码来源:AddressingOutHandlerTest.java

示例8: testModuleIncludeOptionalHeadersFalse

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testModuleIncludeOptionalHeadersFalse() throws Exception {
    File configFile = new File(System.getProperty("basedir",".") + 
            "/test-resources/axis2-noParameters.xml");
    ConfigurationContext cfgCtx = ConfigurationContextFactory
    .createConfigurationContextFromFileSystem("target/test-classes",
            configFile.getAbsolutePath());
    AxisConfiguration config = cfgCtx.getAxisConfiguration();

    // Can't test with a module.xml file in test-resources because it gets
    // overridden by target\classes\META-INF\module.xml, so create our own
    // AxisModule with the required parameter value
    AxisModule module = config.getModule("addressing");
    module.addParameter(new Parameter("includeOptionalHeaders", "false"));
    
    msgCtxt = cfgCtx.createMessageContext();
    msgCtxt.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
    msgCtxt.setTo(new EndpointReference("http://www.to.org/service/"));
    msgCtxt.setFrom(new EndpointReference("http://www.from.org/service/"));
    msgCtxt.setReplyTo(new EndpointReference("http://www.replyTo.org/service/"));
    msgCtxt.setFaultTo(new EndpointReference("http://www.faultTo.org/service/"));
    msgCtxt.setWSAAction("http://www.actions.org/action");
    msgCtxt.setMessageID("123456-7890");
    msgCtxt.addRelatesTo(new RelatesTo("http://www.relatesTo.org/service/"));
    msgCtxt.setProperty(WS_ADDRESSING_VERSION, Final.WSA_NAMESPACE);
    
    outHandler.invoke(msgCtxt);

    XMLUnit.setIgnoreWhitespace(true);
    assertXMLEqual(msgCtxt.getEnvelope().toString(), TestUtil
            .getOMBuilder("addressingEnabledTest.xml")
            .getDocumentElement().toString());   
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:33,代码来源:AddressingOutHandlerTest.java

示例9: addService

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void addService(AxisService service) throws AxisFault {
    if (service == null) {
        return;
    }

    if (serviceGroupName == null) {
        // setup a temporary name based on the first service under this group
        serviceGroupName = service.getName();
    }

    service.setParent(this);

    AxisConfiguration axisConfig = getAxisConfiguration();

    if (axisConfig != null) {
        for (Iterator<AxisModule> iterator = getEngagedModules().iterator(); iterator.hasNext();) {
            Object o = iterator.next();
            AxisModule axisModule;
            if (o instanceof AxisModule) {
                axisModule = (AxisModule) o;
            } else if (o instanceof String) { //Should this be checked
                String moduleName = (String) o;
                axisModule = axisConfig.getModule(moduleName);
                if (axisModule == null) {
                    throw new AxisFault(Messages.getMessage("modulenotavailble", moduleName));
                }
            } else {
                throw new AxisFault(Messages.getMessage("modulenotavailble"));
            }
            service.engageModule(axisModule);
        }

    }
    service.setLastUpdate();
    addChild(service);
    if (axisConfig != null) {
        axisConfig.addToAllServicesMap(service);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:40,代码来源:AxisServiceGroup.java

示例10: unsetConfigurationContextService

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
    AxisConfiguration axisConf = configContext.getAxisConfiguration();
    AxisModule statModule = axisConf.getModule(StatisticsConstants.STATISTISTICS_MODULE_NAME);
    if (statModule != null) {
        try {
            axisConf.disengageModule(statModule);
        } catch (AxisFault axisFault) {
            log.error("Failed disengage module: " + StatisticsConstants.STATISTISTICS_MODULE_NAME);
        }
    }
    this.configContext = null;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:13,代码来源:StatisticsServiceComponent.java

示例11: 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

示例12: ConfigurePermenentStorage

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void ConfigurePermenentStorage(String connectionString,
                                      String driver,
                                      String userName,
                                      String password) throws AxisFault {

    ConfigurationContext configurationContext = getConfigContext();
    AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();

    ModuleConfiguration moduleConfiguration = new ModuleConfiguration("sandesha2", null);
    moduleConfiguration.addParameter(new Parameter("db.connectionstring", connectionString));
    moduleConfiguration.addParameter(new Parameter("db.driver", driver));
    moduleConfiguration.addParameter(new Parameter("db.user", userName));
    moduleConfiguration.addParameter(new Parameter("db.password", password));

    axisConfiguration.addModuleConfig(moduleConfiguration);
    AxisModule sandeshaModule = axisConfiguration.getModule("sandesha2");

    PersistentStorageManager persistentStorageManager =
            new PersistentStorageManager(configurationContext);
    persistentStorageManager.initStorage(sandeshaModule);

    Parameter permenentStorage = axisConfiguration.getParameter(
            Sandesha2Constants.PERMANENT_STORAGE_MANAGER);
    if (permenentStorage != null) {
        axisConfiguration.removeParameter(permenentStorage);
    }
    // change the permenetent storage manager.
    axisConfiguration.addParameter(Sandesha2Constants.PERMANENT_STORAGE_MANAGER,
            persistentStorageManager);


}
 
开发者ID:wso2-attic,项目名称:carbon-qos,代码行数:33,代码来源:RMAdminService.java

示例13: processPolicy

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
private void processPolicy (AxisService axisService, String policyId,
                            PolicyComponent currentPolicyComponent) throws UserStoreException,
        AxisFault {

    AxisConfiguration axisConfiguration = null;
    // Do not apply anything if no policy
    if (StringUtils.isNotEmpty(policyId) && NO_POLICY_ID.equalsIgnoreCase(policyId)) {
        if (axisService != null) {
            UserRealm userRealm = (UserRealm) PrivilegedCarbonContext.getThreadLocalCarbonContext()
                    .getUserRealm();
            String serviceGroupId = axisService.getAxisServiceGroup().getServiceGroupName();
            String serviceName = axisService.getName();
            removeAuthorization(userRealm, serviceGroupId, serviceName);
            axisConfiguration = axisService.getAxisConfiguration();
        }

        if (axisConfiguration != null) {
            AxisModule module = axisConfiguration.getModule(SecurityConstants
                    .RAMPART_MODULE_NAME);
            // disengage at axis2
            axisService.disengageModule(module);
            return;
        } else {
            throw new UserStoreException("Error in getting Axis configuration.");
        }
    }

    if (policyId != null && isSecPolicy(policyId)) {

        if (log.isDebugEnabled()) {
            log.debug("Policy " + policyId + " is identified as a security " +
                    "policy and trying to apply security parameters");
        }

        SecurityScenario scenario = SecurityScenarioDatabase.getByWsuId(policyId);
        if (scenario == null) {
            // if there is no security scenario id,  put default id
            if (log.isDebugEnabled()) {
                log.debug("Policy " + policyId + " does not belongs to a" +
                        " pre-defined security scenario. " +
                        "So treating as a custom policy");
            }
            SecurityScenario securityScenario = new SecurityScenario();
            securityScenario.setScenarioId(
                    SecurityConstants.CUSTOM_SECURITY_SCENARIO);
            securityScenario.setWsuId(policyId);
            securityScenario.setGeneralPolicy(false);
            securityScenario.setSummary(
                    SecurityConstants.CUSTOM_SECURITY_SCENARIO_SUMMARY);
            SecurityScenarioDatabase.put(policyId, securityScenario);
            scenario = securityScenario;
        }
        applySecurityParameters(axisService, scenario,
                (Policy) currentPolicyComponent);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:57,代码来源:SecurityDeploymentInterceptor.java

示例14: setParameters

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void setParameters(RMParameterBean parameters) throws AxisFault {


        ConfigurationContext configurationContext = getConfigContext();
        AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
        AxisModule sandeshaModule = axisConfiguration.getModule("sandesha2");

        // persisting parameters
        String moduleVersion = sandeshaModule.getVersion().toString();
        if (moduleVersion == null) {
            moduleVersion = Resources.ModuleProperties.UNDEFINED;
        }
        String moduleResourcePath = PersistenceUtils.getResourcePath(sandeshaModule);
//        String moduleResourcePath = Resources.ModuleProperties + "sandesha2/" + moduleVersion;

        updateParameter(moduleResourcePath, "db.connectionstring", parameters.getConnectionString(),
                sandeshaModule);
        updateParameter(moduleResourcePath, "db.driver", parameters.getDriverName(), sandeshaModule);
        updateParameter(moduleResourcePath, "db.user", parameters.getUserName(), sandeshaModule);
        updateParameter(moduleResourcePath, "db.password", parameters.getPassword(), sandeshaModule);

        // getting the policy bean to update
        SandeshaPolicyBean sandeshaPolicyBean
                = (SandeshaPolicyBean) axisConfiguration.getParameter(
                Sandesha2Constants.SANDESHA_PROPERTY_BEAN).getValue();

        sandeshaPolicyBean.setInactiveTimeoutInterval(
                parameters.getInactivityTimeoutInterval(), parameters.getInactivityTimeoutMeasure());

        sandeshaPolicyBean.setSequenceRemovalTimeoutInterval(
                parameters.getSequenceRemovalTimeoutInterval(),
                parameters.getSequenceRemovalTimeoutMeasure());
        sandeshaPolicyBean.setSequenceRemovalTimeoutMeasure(parameters.getSequenceRemovalTimeoutMeasure());

        sandeshaPolicyBean.setAcknowledgementInterval(parameters.getAcknowledgementInterval());
        sandeshaPolicyBean.setRetransmissionInterval(parameters.getRetransmissionInterval());
        sandeshaPolicyBean.setExponentialBackoff(parameters.isExponentialBackoff());
        sandeshaPolicyBean.setMaximumRetransmissionCount(parameters.getMaximumRetransmissionCount());

        // if it has set the storage as permenent the we need to initiate storage and put to the
        // configuration context.
        if ((parameters.getStorageManager() != null)
                && (parameters.getStorageManager().equals(Sandesha2Constants.PERMANENT_STORAGE_MANAGER))) {
            sandeshaPolicyBean.setPermanentStorageManagerClass(PersistentStorageManager.class.getName());
            // creating the persistace storage.
            PersistentStorageManager persistentStorageManager = new PersistentStorageManager(configurationContext);
            persistentStorageManager.initStorage(sandeshaModule);

            Parameter permenentStorage = axisConfiguration.getParameter(
                    Sandesha2Constants.PERMANENT_STORAGE_MANAGER);
            if (permenentStorage != null) {
                axisConfiguration.removeParameter(permenentStorage);
            }
            // change the permenetent storage manager.
            axisConfiguration.addParameter(Sandesha2Constants.PERMANENT_STORAGE_MANAGER,
                    persistentStorageManager);

        }

        // this parameter should load at the module init.
        Parameter storageManagerParameter = axisConfiguration.getParameter(
                Sandesha2Constants.STORAGE_MANAGER_PARAMETER);
        if (storageManagerParameter != null) {
            axisConfiguration.removeParameter(storageManagerParameter);
        }
        axisConfiguration.addParameter(Sandesha2Constants.STORAGE_MANAGER_PARAMETER,
                parameters.getStorageManager());
        MessageContext.getCurrentMessageContext().getConfigurationContext().
                setProperty("storageManagerInstance", null);

        updateParameter(moduleResourcePath, Sandesha2Constants.STORAGE_MANAGER_PARAMETER,
                parameters.getStorageManager(), sandeshaModule);

        updatePolicy(moduleResourcePath, sandeshaModule, sandeshaPolicyBean);

    }
 
开发者ID:wso2-attic,项目名称:carbon-qos,代码行数:77,代码来源:RMAdminGlobal.java

示例15: getParameters

import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public RMParameterBean getParameters() throws AxisFault {

        AxisConfiguration axisConfiguration = getAxisConfig();
        AxisModule sandeshaModule = axisConfiguration.getModule("sandesha2");
        RMParameterBean rmParameterBean = new RMParameterBean();

        rmParameterBean.setConnectionString(getParameterValue("db.connectionstring", sandeshaModule));
        rmParameterBean.setDriverName(getParameterValue("db.driver", sandeshaModule));
        rmParameterBean.setPassword(getParameterValue("db.password", sandeshaModule));
        rmParameterBean.setUserName(getParameterValue("db.user", sandeshaModule));

        Parameter sandeshaPolicyBeanParameter = axisConfiguration.getParameter(
                Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        if (sandeshaPolicyBeanParameter != null) {
            SandeshaPolicyBean sandeshaPolicyBean =
                    (SandeshaPolicyBean) sandeshaPolicyBeanParameter.getValue();

            // sandesha policy bean stored them in miliseconds so we make them seconds to display users.
            rmParameterBean.setInactivityTimeoutInterval(
                    sandeshaPolicyBean.getInactivityTimeoutInterval() / 1000);
            rmParameterBean.setInactivityTimeoutMeasure("seconds");

            rmParameterBean.setSequenceRemovalTimeoutInterval(
                    sandeshaPolicyBean.getSequenceRemovalTimeoutInterval() / 1000);
            rmParameterBean.setSequenceRemovalTimeoutMeasure("seconds");

            rmParameterBean.setAcknowledgementInterval(
                    sandeshaPolicyBean.getAcknowledgementInterval());
            rmParameterBean.setRetransmissionInterval(sandeshaPolicyBean.getRetransmissionInterval());
            rmParameterBean.setExponentialBackoff(sandeshaPolicyBean.isExponentialBackoff());
            rmParameterBean.setMaximumRetransmissionCount(
                    sandeshaPolicyBean.getMaximumRetransmissionCount());
        }

        if (axisConfiguration.getParameter(Sandesha2Constants.STORAGE_MANAGER_PARAMETER) != null) {
            rmParameterBean.setStorageManager(
                    (String) axisConfiguration.getParameter(
                            Sandesha2Constants.STORAGE_MANAGER_PARAMETER).getValue());
        }

        return rmParameterBean;

    }
 
开发者ID:wso2-attic,项目名称:carbon-qos,代码行数:44,代码来源:RMAdminGlobal.java


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