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


Java Exchange.setOutMessage方法代码示例

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


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

示例1: prepare

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
public void prepare(final Message message) throws IOException {
    inMessage.getExchange().setOutMessage(message);
    final ZMQ.Socket zmqSocket = (ZMQ.Socket) inMessage.get("socket");

    Exchange exchange = inMessage.getExchange();
    exchange.setOutMessage(message);

    message.setContent(OutputStream.class, new ByteArrayOutputStream() {

        @Override
        public void close() throws IOException {
            super.close();
            if (endpointConfig.getSocketType() == ZMQURIConstants.SocketType.REP) {
                getLogger().log(Level.FINE, "send out the message!");
                if (hasNoResponseContent(message)) {
                    ZMQUtils.sendMessage(zmqSocket, new byte[]{0});
                }
                else {
                    ZMQUtils.sendMessage(zmqSocket, toByteArray());
                }
            }
        }
    });
}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:25,代码来源:ZMQDestination.java

示例2: getOutMessage

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
private Message getOutMessage(Message inMessage) {
    Exchange exchange = inMessage.getExchange();
    Message outMessage = exchange.getOutMessage();
    if (outMessage == null) {
        Endpoint endpoint = exchange.get(Endpoint.class);
        outMessage = endpoint.getBinding().createMessage();
        exchange.setOutMessage(outMessage);
    }
    outMessage.putAll(inMessage);
    return outMessage;
}
 
开发者ID:GovernIB,项目名称:sistra,代码行数:12,代码来源:BasicAuthAuthorizationInterceptor.java

示例3: getOutMessage

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
/**
 * @param inMessage
 * @return Message
 */
private Message getOutMessage(Message inMessage)
{
    Exchange exchange = inMessage.getExchange();
    Message outMessage = exchange.getOutMessage();
    if (outMessage == null)
    {
        Endpoint endpoint = exchange.get(Endpoint.class);
        outMessage = endpoint.getBinding().createMessage();
        exchange.setOutMessage(outMessage);
    }
    outMessage.putAll(inMessage);

    return outMessage;
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:19,代码来源:AuthenticationHandler.java

示例4: shouldRequireFailoverWhereIOExceptionHasBeenThrown

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
@Test
public void shouldRequireFailoverWhereIOExceptionHasBeenThrown() {
	circuitBreakerTargetSelector = new CircuitSwitcherTargetSelector(null, 0, 0, null);

	Exchange exchange = new ExchangeImpl();
	Message message = new SoapMessage(Soap11.getInstance());
	exchange.setOutMessage(message);
	message.put(Exception.class, new IOException());

	boolean requiresFailover = circuitBreakerTargetSelector.requiresFailover(exchange);
	assertTrue(requiresFailover);
}
 
开发者ID:jaceko,项目名称:cxf-circuit-switcher,代码行数:13,代码来源:CircuitSwitcherTargetSelectorTest.java


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