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


            ServiceEndpoint se = componentContext.getEndpoint(serviceName, endpointName);
            if (se != null) {
                exchange.setEndpoint(se);
            }
        }
        NormalizedMessage inMessage = exchange.createMessage();
        jbiMarshaler.toNMS(inMessage, context.getInMessage());
        exchange.setMessage(inMessage, "in");
        return exchange;
    }
View Full Code Here

   
    protected MessageExchange createPart(URI pattern,
                                         NormalizedMessage srcMessage,
                                         Source content) throws Exception {
        MessageExchange me = exchangeFactory.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

        throws MessagingException, URISyntaxException {
       
        MessageExchange jbiExchange = createJbiMessageExchange(camelExchange, exchangeFactory, defaultMep);
        NormalizedMessage normalizedMessage = jbiExchange.getMessage("in");
        if (normalizedMessage == null) {
            normalizedMessage = jbiExchange.createMessage();
            jbiExchange.setMessage(normalizedMessage, "in");
        }
        normalizedMessage.setContent(getJbiInContent(camelExchange));
        addJbiHeaders(jbiExchange, normalizedMessage, camelExchange);
        addJbiAttachments(jbiExchange, normalizedMessage, camelExchange);
View Full Code Here

        Document document = combineToDOMDocument(exchange.getMessage("in"), enricherTargetME.getMessage("out"));

        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

    public MessageExchange createExchange(JmsContext jmsContext, ComponentContext jbiContext)
        throws Exception {
        Context ctx = (Context)jmsContext;
        MessageExchange exchange = jbiContext.getDeliveryChannel().createExchangeFactory()
            .createExchange(mep);
        NormalizedMessage inMessage = exchange.createMessage();
        populateMessage(ctx.message, inMessage);
        if (isCopyProperties()) {
            copyPropertiesFromJMS(ctx.message, inMessage);
        }
        exchange.setMessage(inMessage, "in");
View Full Code Here

        MessageExchange me = this.exchange.getInternalExchange();
        NormalizedMessage in = null;
        if (content == null) {
            in = me.getMessage("in");
        } else {
            in = me.createMessage();
            in.setContent(new StringSource(content));
        }
        MessageExchange newMe = getChannel().createExchangeFactory().createExchange(me.getPattern());
        URIResolver.configureExchange(newMe, getContext(), uri);
        MessageUtil.transferToIn(in, newMe);
View Full Code Here

        if ((me instanceof InOnly) || (me instanceof RobustInOnly)) {
            NormalizedMessage in = null;
            if (content == null) {
                in = me.getMessage("in");
            } else {
                in = me.createMessage();
                in.setContent(new StringSource(content));
            }
            MessageExchange newMe = getChannel().createExchangeFactory().createExchange(me.getPattern());
            URIResolver.configureExchange(newMe, getContext(), uri);
            MessageUtil.transferToIn(in, newMe);
View Full Code Here

     * @param content the response
     * @throws Exception
     */   
    public void answer(Source content) throws Exception {
        MessageExchange me = this.exchange.getInternalExchange();
        NormalizedMessage out = me.createMessage();
        out.setContent(content);
        me.setMessage(out, "out");
        getChannel().sendSync(me);
        exchangeHandled = true;
        update();
View Full Code Here

                MessageExchange me = factory.createExchange(mep);
                me.setInterfaceName((QName) context.getService().getProperty(JBI_INTERFACE_NAME));
                me.setOperation(context.getExchange().getOperation().getQName());
                me.setService((QName) context.getService().getProperty(JBI_SERVICE_NAME));
                me.setEndpoint((ServiceEndpoint) context.getService().getProperty(JBI_ENDPOINT));
                NormalizedMessage msg = me.createMessage();
                me.setMessage(msg, "in");
                if (Boolean.TRUE.equals(context.getService().getProperty(JBI_SECURITY_PROPAGATATION))) {
                    MessageExchange oldMe = JBIContext.getMessageExchange();
                    NormalizedMessage oldMsg = (oldMe != null) ? oldMe.getMessage("in") : null;
                    if (oldMsg != null) {
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.