本文整理汇总了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());
}
}
}
});
}
示例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;
}
示例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;
}
示例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);
}