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


Java Parameter.getName方法代码示例

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


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

示例1: loadTransportProperties

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private static Properties loadTransportProperties() throws Exception {
	
	transportProperties = new Properties();

	try {
		ConfigurationContext configContext = CarbonConfigurationContextFactory.getConfigurationContext();
		AxisConfiguration axisConfig = configContext.getAxisConfiguration();
		TransportOutDescription mailto = axisConfig.getTransportOut("mailto"); 
		ArrayList<Parameter> parameters = mailto.getParameters();
		
           for (Parameter parameter : parameters) {
			String prop = parameter.getName();
			String value = (String)parameter.getValue();
			transportProperties.setProperty(prop, value);
		}
	}
	catch (Exception e) {
		throw e;
	}
	
	return transportProperties;
}
 
开发者ID:vasttrafik,项目名称:wso2-community-api,代码行数:23,代码来源:MailUtil.java

示例2: RabbitMQConnectionFactory

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
 * Digest a AMQP CF definition from an axis2.xml 'Parameter' and construct.
 *
 * @param parameter the axis2.xml 'Parameter' that defined the AMQP CF
 */
@Deprecated
public RabbitMQConnectionFactory(Parameter parameter) {
    this.name = parameter.getName();
    ParameterIncludeImpl pi = new ParameterIncludeImpl();

    try {
        pi.deserializeParameters((OMElement) parameter.getValue());
    } catch (AxisFault axisFault) {
        handleException("Error reading parameters for RabbitMQ connection factory" + name, axisFault);
    }

    for (Object o : pi.getParameters()) {
        Parameter p = (Parameter) o;
        parameters.put(p.getName(), (String) p.getValue());
    }
    initConnectionFactory();
    log.info("RabbitMQ ConnectionFactory : " + name + " initialized");
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:24,代码来源:RabbitMQConnectionFactory.java

示例3: JMSConnectionFactory

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
 * Digest a JMS CF definition from an axis2.xml 'Parameter' and construct.
 * @param parameter the axis2.xml 'Parameter' that defined the JMS CF
 */
@Deprecated
public JMSConnectionFactory(Parameter parameter) {

    this.name = parameter.getName();
    ParameterIncludeImpl pi = new ParameterIncludeImpl();

    try {
        pi.deserializeParameters((OMElement) parameter.getValue());
    } catch (AxisFault axisFault) {
        handleException("Error reading parameters for JMS connection factory" + name, axisFault);
    }

    for (Object o : pi.getParameters()) {
        Parameter p = (Parameter) o;
        parameters.put(p.getName(), (String) p.getValue());
    }

    digestCacheLevel();
    try {
        context = new InitialContext(parameters);
        conFactory = JMSUtils.lookup(context, ConnectionFactory.class,
                parameters.get(JMSConstants.PARAM_CONFAC_JNDI_NAME));
        if (parameters.get(JMSConstants.PARAM_DESTINATION) != null) {
            sharedDestination = JMSUtils.lookup(context, Destination.class,
                    parameters.get(JMSConstants.PARAM_DESTINATION));
        }
        log.info("JMS ConnectionFactory : " + name + " initialized");

    } catch (NamingException e) {
        throw new AxisJMSException("Cannot acquire JNDI context, JMS Connection factory : " +
                parameters.get(JMSConstants.PARAM_CONFAC_JNDI_NAME) + " or default destination : " +
                parameters.get(JMSConstants.PARAM_DESTINATION) +
                " for JMS CF : " + name + " using : " + JMSUtils.maskAxis2ConfigSensitiveParameters(parameters), e);
    }
    setMaxSharedJMSConnectionsCount();
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:41,代码来源:JMSConnectionFactory.java

示例4: MqttConnectionFactory

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public MqttConnectionFactory(Parameter passedInParameter) {
    this.name = passedInParameter.getName();
    ParameterIncludeImpl parameterInclude = new ParameterIncludeImpl();
    try {
        parameterInclude.deserializeParameters((OMElement) passedInParameter.getParameterElement());
    } catch (AxisFault axisFault) {
        log.error("Error while reading properties for MQTT Connection Factory " + name, axisFault);
        throw new AxisMqttException(axisFault);
    }
    for (Object object : parameterInclude.getParameters()) {
        Parameter parameter = (Parameter) object;
        parameters.put(parameter.getName(), (String) parameter.getValue());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:15,代码来源:MqttConnectionFactory.java

示例5: initScript

import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
 * Initializes the script service by finding the script source code,
 * compiling it in a BSFEngine, and creating an OMElementConvertor
 * for the script.
 */
protected BSFEngine initScript(MessageContext mc) throws AxisFault {
    log.debug("initializing script service");

    AxisService axisService = mc.getAxisService();

    String scriptName = null;
    String scriptSrc = null;
    Parameter scriptFileParam = axisService.getParameter(SCRIPT_ATTR);
    if (scriptFileParam != null) {
        // the script is defined in a seperate file
        scriptName = ((String) scriptFileParam.getValue()).trim();
        Parameter scriptSrcParam = axisService.getParameter(SCRIPT_SRC_PROP);
        if (scriptSrcParam != null) {
            scriptSrc = (String) scriptSrcParam.getValue();
        } else {
            scriptSrc = readScript(axisService.getClassLoader(), scriptName);
        }
    } else {
        // the script is defined inline within the services.xml
        ArrayList parameters = axisService.getParameters();
        for (int i=0; scriptFileParam == null && i<parameters.size(); i++) {
            Parameter p = (Parameter) parameters.get(i);
            if (p.getName().startsWith("script.")) {
                scriptFileParam = p;
                scriptName = p.getName();
                scriptSrc = (String) p.getValue();
            }
        }
    }
    if (scriptName == null) {
        throw new AxisFault("Missing script parameter");
    }
    
    try {

        String scriptLanguage = BSFManager.getLangFromFilename(scriptName);
        BSFManager bsfManager = new BSFManager();
        bsfManager.setClassLoader(BSFManager.class.getClassLoader());
        bsfManager.declareBean("_AxisService", axisService, AxisService.class);

        BSFEngine bsfEngine = bsfManager.loadScriptingEngine(scriptLanguage);
        bsfEngine.exec(scriptName, 0, 0, scriptSrc);

        ServiceContext serviceContext = mc.getServiceContext();
        serviceContext.setProperty(BSFENGINE_PROP, bsfEngine);

        OMElementConvertor convertor = ConvertorFactory.createOMElementConvertor(axisService, scriptName);
        serviceContext.setProperty(CONVERTOR_PROP, convertor);

        return bsfEngine;

    } catch (BSFException e) {
        throw AxisFault.makeFault(e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:61,代码来源:ScriptReceiver.java


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