Package javax.jbi.messaging

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


    private void outResponse(MyRoleMessageExchange mex, javax.jbi.messaging.MessageExchange jbiMex) throws MessagingException {
        InOut inout = (InOut) jbiMex;

        try {
            NormalizedMessage nmsg = inout.createMessage();
            String mapperName = mex.getProperty(Mapper.class.getName());
            Mapper mapper = _ode.getMapper(mapperName);
            if (mapper == null) {
                String errmsg = "Message-mapper " + mapperName + " used in ODE MEX " + mex.getMessageExchangeId()
                        + " is no longer available.";
View Full Code Here


    }
   
    protected void handleMessage(final Message jmsMessage) {
        try {
            final InOut messageExchange = getDeliveryChannel().createExchangeFactory().createInOutExchange();
            NormalizedMessage inMessage = messageExchange.createMessage();
            try {
                marshaler.toNMS(inMessage, jmsMessage);
                messageExchange.setInMessage(inMessage);
                if (getDeliveryChannel().sendSync(messageExchange)) {
                    Destination destination = getReplyToDestination(jmsMessage, messageExchange);
View Full Code Here

        return exchange;
    }

    public InOut createInOutExchange() throws MessagingException {
        InOut exchange = getExchangeFactory().createInOutExchange();
        NormalizedMessage in = exchange.createMessage();
        exchange.setInMessage(in);
        return exchange;
    }

    public InOut createInOutExchange(EndpointResolver resolver) throws JBIException {
View Full Code Here

        return exchange;
    }

    public InOut createInOutExchange() throws MessagingException {
        InOut exchange = getExchangeFactory().createInOutExchange();
        NormalizedMessage in = exchange.createMessage();
        exchange.setInMessage(in);
        return exchange;
    }

    public InOut createInOutExchange(EndpointResolver resolver) throws JBIException {
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

                } else if ("getCreditHistoryLength".equals(operation)) {
                    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

                            } else {
                                throw new IllegalArgumentException("JMS message should be a text or bytes message");
                            }
                            String contentType = message.getStringProperty(CONTENT_TYPE);
                            SoapMessage soap = soapHelper.getSoapMarshaler().createReader().read(is, contentType);
                            NormalizedMessage out = exchange.createMessage();
                            soapHelper.getJBIMarshaler().toNMS(out, soap);
                            ((InOut) exchange).setOutMessage(out);
                        }
                        channel.send(exchange);
                    } catch (Throwable e) {
View Full Code Here

                if (context.getExchange().hasOutMessage()) {
                    InOut me = factory.createInOutExchange();
                    me.setInterfaceName((QName) context.getService().getProperty(JBI_INTERFACE_NAME));
                    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");
                    }
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

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.