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


Java MessageContext.getModuleParameter方法代码示例

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


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

示例1: shouldInvoke

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public boolean shouldInvoke(MessageContext msgContext) throws AxisFault {
    Parameter param = null;
    boolean disableAddressing = false;
    
    Object o = msgContext.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
    if (o == null || !(o instanceof Boolean)) {
        //determine whether outbound addressing has been disabled or not.
        // Get default value from module.xml or axis2.xml files
        param = msgContext.getModuleParameter(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, MODULE_NAME, handlerDesc);
        disableAddressing =
            msgContext.isPropertyTrue(DISABLE_ADDRESSING_FOR_OUT_MESSAGES,
                JavaUtils.isTrueExplicitly(Utils.getParameterValue(param)));
    } else {
        disableAddressing = (Boolean) o;
    }

    if (disableAddressing) {
        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
            log.trace(msgContext.getLogIDString() +
                    " Addressing is disabled. Not adding WS-Addressing headers.");
        }
        return false;
    }
    return true;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:AddressingOutHandler.java

示例2: doInvoke

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public InvocationResponse doInvoke(MessageContext msgContext) throws AxisFault {
    

    // Determine the addressin namespace in effect.
    Object addressingVersionFromCurrentMsgCtxt = msgContext.getProperty(WS_ADDRESSING_VERSION);
    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
        log.trace("Addressing version string from messageContext=" +
                addressingVersionFromCurrentMsgCtxt);
    }
    boolean isSubmissionNamespace =
            Submission.WSA_NAMESPACE.equals(addressingVersionFromCurrentMsgCtxt);

    // Determine whether to include optional addressing headers in the output.
    // Get default value from module.xml or axis2.xml files
    Parameter param = msgContext.getModuleParameter(
            INCLUDE_OPTIONAL_HEADERS, MODULE_NAME, handlerDesc);
    boolean includeOptionalHeaders =
        msgContext.isPropertyTrue(INCLUDE_OPTIONAL_HEADERS,
                JavaUtils.isTrueExplicitly(Utils.getParameterValue(param)));

    if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
        log.debug("includeOptionalHeaders=" + includeOptionalHeaders);
    }

    // Determine if a MustUnderstand attribute will be added to all headers in the
    // addressing namespace.
    boolean addMustUnderstandAttribute =
            msgContext.isPropertyTrue(ADD_MUST_UNDERSTAND_TO_ADDRESSING_HEADERS);

    // what if there are addressing headers already in the message. Do you replace that or not?
    // Lets have a parameter to control that. The default behavior is you won't replace addressing
    // headers if there are any (this was the case so far).
    boolean replaceHeaders = msgContext.isPropertyTrue(REPLACE_ADDRESSING_HEADERS);
    
    // Allow the user to specify the role these WS-Addressing headers should be targetted at.
    String role = (String) msgContext.getProperty(SOAP_ROLE_FOR_ADDRESSING_HEADERS);

    WSAHeaderWriter writer = new WSAHeaderWriter(msgContext, isSubmissionNamespace,
                                                 addMustUnderstandAttribute, replaceHeaders,
                                                 includeOptionalHeaders, role);
    writer.writeHeaders();

    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:45,代码来源:AddressingOutHandler.java


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