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


Java Exchange.getOutMessage方法代码示例

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


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

示例1: closeConduit

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
public static void closeConduit(Exchange exchange) throws IOException {
    ConduitSelector conduitSelector = null;
    synchronized (exchange) {
        conduitSelector = exchange.get(ConduitSelector.class);
        if (conduitSelector != null) {
            exchange.remove(ConduitSelector.class.getName());
        }
    }

    Conduit selectedConduit = null;
    Message message = exchange.getInMessage() == null ? exchange
            .getOutMessage() : exchange.getInMessage();

    if (conduitSelector != null && message != null) {
        selectedConduit = conduitSelector.selectConduit(message);
        selectedConduit.close(message);
    }

    //TODO the line below was removed, check the impact on the protobuffer importer/exporter
    //selectedConduit.close(message);
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:22,代码来源:ExchangeUtils.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: performFailover

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
private boolean performFailover(Exchange exchange, InvocationContext invocation) {
	Exception prevExchangeFault = (Exception) exchange.remove(Exception.class.getName());
	Message outMessage = exchange.getOutMessage();
	Exception prevMessageFault = outMessage.getContent(Exception.class);
	outMessage.setContent(Exception.class, null);
	overrideAddressProperty(invocation.getContext());
	Retryable retry = exchange.get(Retryable.class);
	exchange.clear();
	boolean failover = false;
	if (retry != null) {
		try {
			failover = true;
			long delay = getDelayBetweenRetries();
			if (delay > 0) {
				Thread.sleep(delay);
			}
			Map<String, Object> context = invocation.getContext();
			retry.invoke(invocation.getBindingOperationInfo(), invocation.getParams(), context,
					exchange);
		} catch (Exception e) {
			if (exchange.get(Exception.class) != null) {
				exchange.put(Exception.class, prevExchangeFault);
			}
			if (outMessage.getContent(Exception.class) != null) {
				outMessage.setContent(Exception.class, prevMessageFault);
			}
		}
	}
	return failover;
}
 
开发者ID:jaceko,项目名称:cxf-circuit-switcher,代码行数:31,代码来源:CircuitSwitcherTargetSelector.java

示例5: isOutbound

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
private boolean isOutbound(Message message, Exchange ex) {
   return message == ex.getOutMessage()
       || message == ex.getOutFaultMessage();
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:5,代码来源:HandlerChainSortInterceptor.java

示例6: sendExchange

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
public void sendExchange(final Exchange exchange, final byte[] request) {
    LOG.log(Level.FINE, "ZMQConduit send message");

    final Message outMessage = exchange.getOutMessage() == null
            ? exchange.getOutFaultMessage()
            : exchange.getOutMessage();

    if (outMessage == null) {
        throw new RuntimeException("Exchange to be sent has no outMessage");
    }

    synchronized (exchange) {
        try {
            ZMQUtils.sendMessage(zmqSocket, request);
        }
        catch (ZMQException e) {
            if (e.getErrorCode() == ZMQURIConstants.ERR_EFSM) {
                LOG.log(Level.WARNING, "The operation can not be executed because the socket is not in correct state. Creating new socket and retrying operation...");
                zmqSocket.close();
                zmqSocket = ZMQResourceFactory.createSocket(endpointConfig, zmqContext);
                ZMQUtils.sendMessage(zmqSocket, request);
            }
            else {
                throw e;
            }

        }

        byte[] reply;

        if (isOneway(exchange) || !(endpointConfig.getSocketType().equals(ZMQURIConstants.SocketType.REQ))) {

            if (endpointConfig.getSocketType().equals(ZMQURIConstants.SocketType.REQ)) {
                reply = ZMQUtils.receiveMessage(zmqSocket);
                if ((reply.length == 1 && reply[0] == 0) || !doProcessResponse(outMessage)) {
                    return;
                }
            } else {
                return;
            }

        } else {
            reply = ZMQUtils.receiveMessage(zmqSocket);
        }

        Message inMessage = new MessageImpl();
        exchange.setInMessage(inMessage);
        inMessage.setContent(InputStream.class, new ByteArrayInputStream(reply));
        if (exchange.isSynchronous()) {
            exchange.notifyAll();
        }
    }

    if (incomingObserver != null) {
        incomingObserver.onMessage(exchange.getInMessage());
    }

}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:59,代码来源:ZMQConduit.java


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