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


Java Exchange.notifyAll方法代码示例

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


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

示例1: setExchangeFinished

import org.apache.cxf.message.Exchange; //导入方法依赖的package包/类
public static void setExchangeFinished(Exchange exchange) {
    synchronized (exchange) {
        if (!isExchangeFinished(exchange)) {
            exchange.put(ClientImpl.FINISHED, Boolean.TRUE);
            exchange.notifyAll();
        }
    }
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:9,代码来源:ExchangeUtils.java

示例2: 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.notifyAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。