Package javax.jbi.messaging

Examples of javax.jbi.messaging.MessageExchange.createMessage()


        MessageExchangeFactory factory = channel.createExchangeFactory();
        MessageExchange me = factory.createExchange(exchange.getPattern());
        me.setInterfaceName(interfaceName);
        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());
View Full Code Here


                exchange.setProperty(correlation, outExchange.getExchangeId());
                String processCorrelationId = (String)exchange.getProperty(JbiConstants.CORRELATION_ID);
                if (processCorrelationId != null) {
                    outExchange.setProperty(JbiConstants.CORRELATION_ID, processCorrelationId);
                }
                out = outExchange.createMessage();
            }
            boolean txSync = exchange.isTransacted() && Boolean.TRUE.equals(exchange.getProperty(JbiConstants.SEND_SYNC));
            copyPropertiesAndAttachments(exchange, in, out);
            if (transform(exchange, in, out)) {
                if (isInAndOut(exchange)) {
View Full Code Here

                xchng = factory.createInOnlyExchange();
            } else {
                xchng = factory.createInOutExchange();
            }

            NormalizedMessage inMsg = xchng.createMessage();
            LOG.info(new org.apache.cxf.common.i18n.Message("EXCHANGE.ENDPOINT", LOG).toString()
                     + xchng.getEndpoint());

            InputStream ins = null;
View Full Code Here

           
                MessageExchange xchng = (MessageExchange)inMessage.get(
                    JBIConstants.MESSAGE_EXCHANGE_PROPERTY);
                LOG.fine(new org.apache.cxf.common.i18n.Message(
                    "CREATE.NORMALIZED.MESSAGE", LOG).toString());
                NormalizedMessage msg = xchng.createMessage();
                msg.setContent(new DOMSource(doc));
                LOG.info("the message class is " + xchng.getClass().getName());
                xchng.setMessage(msg, "out");
                LOG.fine(new org.apache.cxf.common.i18n.Message(
                    "POST.DISPATCH", LOG).toString());
View Full Code Here

                xchng = factory.createRobustInOnlyExchange();
            } else {
                xchng = factory.createInOutExchange();
            }

            NormalizedMessage inMsg = xchng.createMessage();
            LOG.info(new org.apache.cxf.common.i18n.Message("EXCHANGE.ENDPOINT", LOG).toString()
                     + xchng.getEndpoint());
            if (inMsg != null) {
                LOG.info("setup message contents on " + inMsg);
                inMsg.setContent(getMessageContent(message));
View Full Code Here

        update();
    }

    public void answer(String content) throws Exception {
        MessageExchange exchange = this.exchange.getInternalExchange();
        NormalizedMessage out = exchange.createMessage();
        out.setContent(new StringSource(content));
        exchange.setMessage(out, "out");
        getChannel().sendSync(exchange);
        update();
    }
View Full Code Here

            MessageExchange me = factory.createExchange(this.mep);
            me.setInterfaceName(interfaceName);
            me.setService(serviceName);
            // TODO: set endpoint
            me.setOperation(operationName);
            NormalizedMessage nm = me.createMessage();
            me.setMessage(nm, "in");
            nm.setContent(inputSource);
            boolean res = channel.sendSync(me);
            if (!res) {
                throw new ActionSystemException("Timeout on sending message");
View Full Code Here

   
    protected MessageExchange createPart(URI pattern,
                                         NormalizedMessage srcMessage,
                                         Source content) throws Exception {
        MessageExchange me = getExchangeFactory().createExchange(pattern);
        NormalizedMessage in = me.createMessage();
        in.setContent(content);
        me.setMessage(in, "in");
        if (forwardAttachments) {
            Set names = srcMessage.getAttachmentNames();
            for (Iterator iter = names.iterator(); iter.hasNext();) {
View Full Code Here

    public String send(String content, String operation, String mep) {
        ServiceMixClient client = null;
        try {
            client = registry.getContainer().getClientFactory().createClient();
            MessageExchange me = client.getExchangeFactory().createExchange(URI.create(mep));
            NormalizedMessage nm = me.createMessage();
            me.setMessage(nm, "in");
            nm.setContent(new StringSource(content));
            me.setEndpoint(endpoint);
            if (operation != null) {
                me.setOperation(QNameUtil.parse(operation));
View Full Code Here

               
        done(enricherTargetME);

      MessageExchange outExchange =
        getExchangeFactory().createInOnlyExchange();
      NormalizedMessage out = outExchange.createMessage();
      target.configureTarget(outExchange, getContext());
        out.setContent(new DOMSource(document));
       
        outExchange.setMessage(out, "in");
               
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.