Package javax.jbi.messaging

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


       
        channel.createExchangeFactoryForService(serviceName);
        EasyMock.expectLastCall().andReturn(factory);
        factory.createInOutExchange();
        EasyMock.expectLastCall().andReturn(exchange);
        exchange.createMessage();
        EasyMock.expectLastCall().andReturn(message);
        exchange.getEndpoint();
        EasyMock.expectLastCall().andReturn(null);
        message.setContent((Source)EasyMock.notNull());
        exchange.setService(serviceName);
View Full Code Here


           
            MessageExchangeFactory factory = channel.createExchangeFactoryForService(serviceName);
            LOG.fine("create message exchange svc: " + serviceName);
            InOut xchng = factory.createInOutExchange();
           
            NormalizedMessage inMsg = xchng.createMessage();
            LOG.fine("exchange endpoint: " + xchng.getEndpoint());
           
            InputStream ins = null;
           
            if (inMsg != null) {
View Full Code Here

        QName[] recipients = (QName[]) getOutProperty(exchange, Constants.PROPERTY_RECIPIENTS);
        ag.numbers = recipients.length;
        for (int i = 0; i < recipients.length; i++) {
            InOut inout = createInOutExchange(recipients[i], null, null);
            inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
            NormalizedMessage msg = inout.createMessage();
            msg.setProperty(Constants.PROPERTY_SSN, ag.ssn);
            msg.setProperty(Constants.PROPERTY_AMOUNT, ag.amount);
            msg.setProperty(Constants.PROPERTY_DURATION, ag.duration);
            msg.setProperty(Constants.PROPERTY_SCORE, ag.score);
            msg.setProperty(Constants.PROPERTY_HISTORYLENGTH, ag.hlength);
View Full Code Here

        ag.score  = (Integer) getOutProperty(exchange, Constants.PROPERTY_SCORE);
        ag.hlength = (Integer) getOutProperty(exchange, Constants.PROPERTY_HISTORYLENGTH);
        // Send to lender gateway
        InOut inout = createInOutExchange(new QName(Constants.LOANBROKER_NS, Constants.LENDERGATEWAY_SERVICE), null, null);
        inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
        NormalizedMessage msg = inout.createMessage();
        msg.setProperty(Constants.PROPERTY_SCORE, ag.score);
        msg.setProperty(Constants.PROPERTY_HISTORYLENGTH, ag.hlength);
        msg.setProperty(Constants.PROPERTY_AMOUNT, ag.amount);
        inout.setInMessage(msg);
        send(inout);
View Full Code Here

            ag.duration = (Integer) getInProperty(exchange, Constants.PROPERTY_DURATION);
            aggregations.put(id, ag);
           
            InOut inout = createInOutExchange(new QName(Constants.LOANBROKER_NS, Constants.CREDITAGENCY_SERVICE), null, null);
            inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
            NormalizedMessage msg = inout.createMessage();
            msg.setProperty(Constants.PROPERTY_SSN, ag.ssn);
            inout.setInMessage(msg);
            send(inout);
        }
    }
View Full Code Here

            return;
        }
        System.err.println(inOut.getService().getLocalPart() + " requested");
        try {
            String output = "<getLoanQuoteResponse xmlns=\"urn:logicblaze:soa:bank\"><rate>" + (Math.ceil(1000 * Math.random()) / 100) + "</rate></getLoanQuoteResponse>";
            NormalizedMessage answer = inOut.createMessage();
            answer.setContent(new StringSource(output));
            inOut.setOutMessage(answer);
            channel.send(inOut);
        } catch (Exception e) {
            inOut.setError(e);
View Full Code Here

        component.getServiceUnitManager().init("proxy", getServiceUnitPath("proxy"));
        component.getServiceUnitManager().start("proxy");
       
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange(new QName("http://test", "Echo"), null, null);
        me.setInMessage(me.createMessage());
        me.getInMessage().setContent(new StringSource("<echo xmlns='http://test'><msg>world</msg></echo>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getOutMessage());
        client.done(me);
View Full Code Here

        }
        log.info(getService().getLocalPart() + " requested");
        try {
            String output = "<getLoanQuoteResponse xmlns=\"urn:logicblaze:soa:bank\"><rate>"
                + (Math.ceil(1000 * Math.random()) / 100) + "</rate></getLoanQuoteResponse>";
            NormalizedMessage answer = inOut.createMessage();
            answer.setContent(new StringSource(output));
            answer(inOut, answer);
        } catch (Exception e) {
            throw new MessagingException(e);
        }
View Full Code Here

                    output = "<getCreditHistoryLengthResponse xmlns=\"urn:logicblaze:soa:creditagency\"><length>"
                        + getCreditHistoryLength(ssn) + "</length></getCreditHistoryLengthResponse>";
                } else {
                    throw new UnsupportedOperationException(operation);
                }
                NormalizedMessage answer = inOut.createMessage();
                answer.setContent(new StringSource(output));
                answer(inOut, answer);
            }
        } catch (Exception e) {
            throw new MessagingException(e);
View Full Code Here

        public Source twoWay(Source src) throws Exception {
            DeliveryChannel channel = context.getDeliveryChannel();
            MessageExchangeFactory factory = channel.createExchangeFactory();
            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);
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.