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


Java MessageUtils.isPartialResponse方法代码示例

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


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

示例1: hasNoResponseContent

import org.apache.cxf.message.MessageUtils; //导入方法依赖的package包/类
/**
 * Determines if the current message has no response content.
 * The message has no response content if either:
 * - the request is oneway and the current message is no partial
 * response or an empty partial response.
 * - the request is not oneway but the current message is an empty partial
 * response.
 *
 * @param message
 * @return
 */
private boolean hasNoResponseContent(Message message) {
    final boolean ow = isOneWay(message);
    final boolean pr = MessageUtils.isPartialResponse(message);
    final boolean epr = MessageUtils.isEmptyPartialResponse(message);

    //REVISIT may need to provide an option to choose other behavior?
    // old behavior not suppressing any responses  => ow && !pr
    // suppress empty responses for oneway calls   => ow && (!pr || epr)
    // suppress additionally empty responses for decoupled twoway calls =>
    return (ow && (!pr || epr)) || (!ow && epr);
}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:23,代码来源:ZMQDestination.java

示例2: handle

import org.apache.cxf.message.MessageUtils; //导入方法依赖的package包/类
/** 
     * Determines the effective policy, and checks if one of its alternatives  
     * is supported.
     *  
     * @param message
     * @throws PolicyException if none of the alternatives is supported
     */
    protected void handle(Message message) {
        
        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
        if (null == aim) {
            return;
        }

        Exchange exchange = message.getExchange();
        BindingOperationInfo boi = exchange.get(BindingOperationInfo.class);
        if (null == boi) {
            LOG.fine("No binding operation info.");
            return;
        }
        
        Endpoint e = exchange.get(Endpoint.class);
        if (null == e) {
            LOG.fine("No endpoint.");
            return;
        } 
        EndpointInfo ei = e.getEndpointInfo();

        Bus bus = exchange.get(Bus.class);
        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
        if (null == pe) {
            return;
        }
        
        if (MessageUtils.isPartialResponse(message)) {
            LOG.fine("Not verifying policies on inbound partial response.");
            return;
        }
        
        getTransportAssertions(message);  
        
        EffectivePolicy effectivePolicy = message.get(EffectivePolicy.class);
        if (effectivePolicy == null) {
            if (MessageUtils.isRequestor(message)) {
                effectivePolicy = pe.getEffectiveClientResponsePolicy(ei, boi);
            } else {
                effectivePolicy = pe.getEffectiveServerRequestPolicy(ei, boi);
            }
        }
        try {
//            List<List<Assertion>> usedAlternatives = aim.checkEffectivePolicy(effectivePolicy.getPolicy());
//            if (usedAlternatives != null && !usedAlternatives.isEmpty() && message.getExchange() != null) {
//                message.getExchange().put("ws-policy.validated.alternatives", usedAlternatives);
//            }
        } catch (PolicyException ex) {
            //To check if there is ws addressing policy violation and throw WSA specific 
            //exception to pass jaxws2.2 tests
            if (ex.getMessage().indexOf("Addressing") > -1) {
                throw new Fault("A required header representing a Message Addressing Property " 
                                    + "is not present", LOG)
                    .setFaultCode(new QName("http://www.w3.org/2005/08/addressing", 
                                              "MessageAddressingHeaderRequired"));
            }
            throw ex;
        }
        LOG.fine("Verified policies for inbound message.");
    }
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:68,代码来源:PolicyVerificationInInterceptor.java


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