Examples of MessageExchange


Examples of com.eviware.soapui.model.iface.MessageExchange

    return messageExchange;
  }

  public void setMessageExchange( MessageExchange messageExchange )
  {
    MessageExchange oldExchange = this.messageExchange;
    this.messageExchange = messageExchange;

    notifyPropertyChanged( MESSAGE_EXCHANGE, oldExchange, messageExchange );
  }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

                @Override
                protected void processFuture ()
                    throws ExecutionException, InterruptedException {

                    MessageExchange me = f.get();
                    if (me.getResponseMessage() == null) {
                        LoggerUtils.logMsg(logger, elections.getRepImpl(),
                                           formatter, Level.FINE,
                                           "No response from: " + me.target +
                                           " reason: " + me.exception);
                        return;
                    }

                    if (me.getResponseMessage().getOp() ==
                        elections.getProtocol().REJECT) {
                        /*
                         * The acceptor has already received a higher numbered
                         * Prepare request. Abandon this round as an
                         * optimization.
                         */
                        Utils.discardFutures
                            (futures.subList(futures.indexOf(f),
                                             futures.size()));
                        phase1HigherProposal.increment();
                        throw new HigherNumberedProposal(me.target);
                    } else if (me.getResponseMessage().getOp() ==
                            elections.getProtocol().PROMISE) {
                        result.promisories.add(me.target);
                        result.promisoryMessages.add(me);
                        Promise accept = (Promise) me.getResponseMessage();
                        Proposal acceptProposal = accept.getHighestProposal();
                        if ((result.acceptProposal == null) ||
                            ((acceptProposal != null) &&
                             (acceptProposal.compareTo(result.acceptProposal) >
                              0))) {
                            result.acceptProposal = acceptProposal;
                            result.acceptedValue = accept.getAcceptedValue();
                        }
                    } else if (me.getResponseMessage().getOp() ==
                               elections.getProtocol().PROTOCOL_ERROR){
                        ProtocolError protocolError =
                            (ProtocolError) me.getResponseMessage();
                        /* Possible protocol version, group, or config skew. */
                        LoggerUtils.logMsg(logger, elections.getRepImpl(),
                                           formatter, Level.WARNING,
                                           "Election protocol error: " +
                                           protocolError.getMessage());
                        return;
                    } else {
                        throw EnvironmentFailureException.unexpectedState
                            ("Unknown response: " +
                             me.getResponseMessage().getOp());
                    }
                }
            }.execute(logger, elections.getRepImpl(), null);
        }

View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

                    @Override
                    protected void processFuture()
                        throws ExecutionException, InterruptedException {

                        MessageExchange me = f.get();
                        final ResponseMessage responseMessage =
                            me.getResponseMessage();
                        if (responseMessage == null) {
                            LoggerUtils.logMsg(logger, elections.getRepImpl(),
                                               formatter, Level.WARNING,
                                               "No response from: " +
                                               me.target + " reason: " +
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

        List<Future<MessageExchange>> futures =
            new LinkedList<Future<MessageExchange>>();

        for (InetSocketAddress socketAddress : targets) {
            MessageExchange me = requestMessage.getProtocol()
            .new MessageExchange(socketAddress, serviceName, requestMessage);
            try {
                futures.add(threadPool.submit(me, me));
            } catch (RejectedExecutionException ree) {
                if (threadPool.isTerminated()) {
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

            new NodeStateProtocol(group.getName(),
                                  NameIdPair.NOCHECK,
                                  null);
        for (ReplicationNode repNode : group.getElectableNodes()) {
            /* Send out a NodeState request message for this electable node. */
            MessageExchange me = stateProtocol.new MessageExchange
                (repNode.getSocketAddress(),
                 NodeStateService.SERVICE_NAME,
                 stateProtocol.new NodeStateRequest(repNode.getName()));
            me.run();
            ResponseMessage resp = me.getResponseMessage();
            if (resp instanceof NodeStateResponse) {
                NodeStateResponse response = (NodeStateResponse) resp;
                notifyJoin(new JoinGroupEvent(response.getNodeName(),
                                              response.getMasterName(),
                                              response.getJoinTime()));
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

            for (final Future<MessageExchange> f : futures) {
                new Utils.WithFutureExceptionHandler () {
                    @Override
                    protected void processFuture ()
                        throws ExecutionException, InterruptedException {
                        MessageExchange me = f.get();

                        if (me.getResponseMessage() == null) {
                            return;
                        }
                        if (me.getResponseMessage().getOp() ==
                            protocol.MASTER_QUERY_RESPONSE){
                            MasterQueryResponse accept =
                                (MasterQueryResponse) me.getResponseMessage();
                            MasterValue masterValue =
                                (MasterValue) accept.getValue();
                            if ((masterValue != null) &&
                                 masterValue.getNameId().
                                 equals(protocol.getNameIdPair())) {
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

                    protected void processFuture ()
                        throws ExecutionException, InterruptedException {
                        /**
                         *  Wait for futures to complete and check for errors.
                         */
                        MessageExchange me = f.get();
                        ResponseMessage response = me.getResponseMessage();
                        if (response == null) {
                            return;
                        }
                        if (response.getOp() ==
                            protocol.MASTER_QUERY_RESPONSE){
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

        /* Consume the futures. */
        int errors = 0;
        for (Future<MessageExchange> f : futures) {
            try {
                MessageExchange me = f.get();
                if (me.getResponseMessage() == null) {
                    /* Simply log it, the nodes may be down. */
                    LoggerUtils.logMsg(logger,
                                       repImpl,
                                       formatter,
                                       Level.FINE,
View Full Code Here

Examples of com.sleepycat.je.rep.impl.TextProtocol.MessageExchange

               MemberNotFoundException,
               UnknownMasterException {

        /* Do the communication. */
        final InetSocketAddress masterAddress = getMasterSocket();
        final MessageExchange me = groupProtocol.new MessageExchange
            (masterAddress, GroupService.SERVICE_NAME, request);
        me.run();

        TestHookExecute.doHookIfSet(testHook);

        ResponseMessage resp = me.getResponseMessage();

        if (resp == null) {
            if (me.getException() != null) {
                throw new UnknownMasterException
                    ("Problem communicating with master.", me.getException());
            }
            /*
             * Returning null on success is part of the message protocol, the
             * caller expects it.
             */
 
View Full Code Here

Examples of javax.jbi.messaging.MessageExchange

            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            LOG.finest("building document from bytes");
            DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
            Document doc = builder.parse(bais);
           
            MessageExchange xchng = (MessageExchange)ctx.get(MESSAGE_EXCHANGE_PROPERTY);
            LOG.fine("creating NormalizedMessage");
            NormalizedMessage msg = xchng.createMessage();
            msg.setContent(new DOMSource(doc));
            xchng.setMessage(msg, "out");
            LOG.fine("postDispatch sending out message to NWR");
            channel.send(xchng);
        } catch (Exception ex) {
            LOG.log(Level.SEVERE, "error sending Out message", ex);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.