Package javax.jbi.messaging

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


    public void testInOutWithFault() throws Exception {
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOut mec = mef.createInOutExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        consumer.getChannel().send(mec);
        // Provider side
        InOut mep = (InOut) provider.getChannel().accept(100L);
View Full Code Here


    public void testInOutWithFaultAndError() throws Exception {
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOut mec = mef.createInOutExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        consumer.getChannel().send(mec);
        // Provider side
        InOut mep = (InOut) provider.getChannel().accept(100L);
View Full Code Here

    public void testInOutWithError1() throws Exception {
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOut mec = mef.createInOutExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        consumer.getChannel().send(mec);
        // Provider side
        InOut mep = (InOut) provider.getChannel().accept(100L);
View Full Code Here

        consumer.getChannel().send(mec);
        // Provider side
        InOut mep = (InOut) provider.getChannel().accept(100L);
        assertNotNull(mep);
        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
        m = mep.createMessage();
        m.setContent(new StringSource(RESPONSE));
        mep.setStatus(ExchangeStatus.ERROR);
        provider.getChannel().send(mep);
        // Consumer side
        mec = (InOut) consumer.getChannel().accept(100L);
View Full Code Here

    public void testInOutWithError2() throws Exception {
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOut mec = mef.createInOutExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        consumer.getChannel().send(mec);
        // Provider side
        InOut mep = (InOut) provider.getChannel().accept(100L);
View Full Code Here

        consumer.getChannel().send(mec);
        // Provider side
        InOut mep = (InOut) provider.getChannel().accept(100L);
        assertNotNull(mep);
        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
        m = mep.createMessage();
        m.setContent(new StringSource(RESPONSE));
        provider.getChannel().send(mep);
        // Consumer side
        mec = (InOut) consumer.getChannel().accept(100L);
        assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
View Full Code Here

    private void outResponse(MyRoleMessageExchange mex, javax.jbi.messaging.MessageExchange jbiMex) {
        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

                inonly.setInMessage(nmsg);
                doSendJBI(odeMex, inonly);
                odeMex.replyOneWayOk();
            } else {
                final InOut inout = (InOut) jbiMex;
                NormalizedMessage nmsg = inout.createMessage();
                mapper.toNMS(nmsg, odeMex.getRequest(), odeMex.getOperation().getInput().getMessage(), null);
                inout.setInMessage(nmsg);
                doSendJBI(odeMex, inout);
                odeMex.replyAsync(inout.getExchangeId());
            }
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

    public void processInOut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException,
            JBIException {
        MessageExchangeFactory factory = getExchangeFactory();
        InOut exchange = factory.createInOutExchange();
        NormalizedMessage inMessage = exchange.createMessage();
        try {
            getMarshaler().toNMS(exchange, inMessage, request);
            exchange.setInMessage(inMessage);
            boolean result = getDeliveryChannel().sendSync(exchange);
            if (result) {
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.