Package javax.jbi.messaging

Examples of javax.jbi.messaging.DeliveryChannel.sendSync()


        me.setService(service);
        me.setOperation(operation);
        NormalizedMessage nm = me.createMessage();
        me.setMessage(nm, "in");
        getMessageTransformer().transform(exchange, in, nm);
        channel.sendSync(me);
        if (me.getStatus() == ExchangeStatus.ERROR) {
            fail(exchange, me.getError());
        } else if (me.getStatus() == ExchangeStatus.DONE) {
            done(exchange);
        } else {
View Full Code Here


          for (Iterator iter = names.iterator(); iter.hasNext();) {
              String name = (String) iter.next();
              me.setProperty(name, exchange.getProperty(name));
          }
          if (Boolean.TRUE.equals(exchange.getProperty(JbiConstants.SEND_SYNC))) {
              channel.sendSync(me);
          } else {
              channel.send(me);
          }
      }
    }
View Full Code Here

            InOut inout = factory.createInOutExchange();
            inout.setService(ReceiverComponent.SERVICE);
            NormalizedMessage msg = inout.createMessage();
            msg.setContent(src);
            inout.setInMessage(msg);
            channel.sendSync(inout);
            Source outSrc = inout.getOutMessage().getContent();
            inout.setStatus(ExchangeStatus.DONE);
            channel.send(inout);
            return outSrc;
        }
View Full Code Here

                    me.setService((QName) context.getService().getProperty(JBI_SERVICE_NAME));
                    me.setEndpoint((ServiceEndpoint) context.getService().getProperty(JBI_ENDPOINT));
                    NormalizedMessage msg = me.createMessage();
                    me.setInMessage(msg);
                    msg.setContent(getContent(context, message));
                    if (!channel.sendSync(me)) {
                        throw new XFireException("Unable to send jbi exchange: sendSync returned false");
                    }
                    if (me.getStatus() == ExchangeStatus.ERROR) {
                        me.setStatus(ExchangeStatus.DONE);
                        channel.send(me);
View Full Code Here

            InOut inout = channel.createExchangeFactory().createInOutExchange();
            inout.setService(jbiBinding.getServiceName());
            NormalizedMessage in = inout.createMessage();
            inout.setInMessage(in);
            in.setContent(new StringSource(baos.toString()));
            boolean sent = channel.sendSync(inout);
            // TODO: check for error ?
            NormalizedMessage out = inout.getOutMessage();
            Object response = context.createUnmarshaller().unmarshal(out.getContent());
            inout.setStatus(ExchangeStatus.DONE);
            channel.send(inout);
View Full Code Here

                        msg.setSecuritySubject(oldMsg.getSecuritySubject());
                    }
                }
                me.setOperation(context.getExchange().getOperation().getQName());
                msg.setContent(getContent(context, message));
                if (!channel.sendSync(me)) {
                    throw new XFireException("Unable to send jbi exchange: sendSync returned false");
                }
                if (me.getStatus() == ExchangeStatus.ERROR) {
                    if (me.getError() != null) {
                        throw new XFireFault(me.getError(), XFireFault.RECEIVER);
View Full Code Here

            InOut inout = factory.createInOutExchange();
            inout.setService(ReceiverComponent.SERVICE);
            NormalizedMessage msg = inout.createMessage();
            msg.setContent(src);
            inout.setInMessage(msg);
            channel.sendSync(inout);
            Source outSrc = inout.getOutMessage().getContent();
            inout.setStatus(ExchangeStatus.DONE);
            channel.send(inout);
            return outSrc;
        }
View Full Code Here

          }
            DeliveryChannel channel = getDeliveryChannel();
            MessageExchangeFactory factory = channel.createExchangeFactory();
            InOnly exchange = factory.createInOnlyExchange();
            populateExchange(exchange, source, context);
            boolean result = channel.sendSync(exchange);
            if (!result) {
                throw new XFireFault("Error sending exchange", XFireFault.SENDER);
            }
        } catch (XFireFault e) {
            throw e;
View Full Code Here

          }
            DeliveryChannel channel = getDeliveryChannel();
            MessageExchangeFactory factory = channel.createExchangeFactory();
            InOut exchange = factory.createInOutExchange();
            populateExchange(exchange, source, context);
            boolean result = channel.sendSync(exchange);
            if (!result) {
                throw new XFireFault("Error sending exchange", XFireFault.SENDER);
            }
            if (exchange.getStatus() == ExchangeStatus.ERROR) {
                Exception e = exchange.getError();
View Full Code Here

                }
            }
            NormalizedMessage outMessage = exchange.getOutMessage();
            if (outMessage == null) {
                exchange.setError(new Exception("Expected an out message"));
                channel.sendSync(exchange);
                throw new XFireFault("No response", XFireFault.SENDER);
            }                   
            Source src = exchange.getOutMessage().getContent();
            exchange.setStatus(ExchangeStatus.DONE);
            channel.send(exchange);
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.