Package javax.jbi.messaging

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


            fail("Message already set");
        } catch (Exception e) {
            // ok
        }
        try {
            mec.setMessage(mec.createMessage(), "out");
            fail("Out not supported");
        } catch (Exception e) {
            // ok
        }
        try {
View Full Code Here


    }

    public void testInOnlyWithError() throws Exception {
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOnly mec = mef.createInOnlyExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        assertEquals(Role.CONSUMER, mec.getRole());
        consumer.getChannel().send(mec);
        // Provider side
View Full Code Here

            }
        }).start();
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOnly mec = mef.createInOnlyExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        boolean result = consumer.getChannel().sendSync(mec, 10000L);
        assertTrue(result);
        assertEquals(ExchangeStatus.DONE, mec.getStatus());
View Full Code Here

    public void testInOnlySyncWithTimeoutBeforeAccept() throws Exception {
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOnly mec = mef.createInOnlyExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        boolean result = consumer.getChannel().sendSync(mec, 100L);
        assertFalse(result);
        assertEquals(ExchangeStatus.ERROR, mec.getStatus());
View Full Code Here

        });
        t.start();
        // Send message exchange
        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
        InOnly mec = mef.createInOnlyExchange();
        NormalizedMessage m = mec.createMessage();
        m.setContent(new StringSource(PAYLOAD));
        mec.setInMessage(m);
        boolean result = consumer.getChannel().sendSync(mec, 50L);

        assertFalse(result);
View Full Code Here

        Mapper mapper = _ode.getDefaultMapper();
        odeMex.setProperty(Mapper.class.getName(), mapper.getClass().getName());
        try {
            if (!isTwoWay) {
                final InOnly inonly = ((InOnly) jbiMex);
                NormalizedMessage nmsg = inonly.createMessage();
                mapper.toNMS(nmsg, odeMex.getRequest(), odeMex.getOperation().getInput().getMessage(), null);
                inonly.setInMessage(nmsg);
                doSendJBI(odeMex, inonly);
                odeMex.replyOneWayOk();
            } else {
View Full Code Here

      DeliveryChannel channel = getDeliveryChannel();
      MessageExchangeFactory mef = getExchangeFactory();
        for(int i=1; i <= msgCount;i++) {
          MimeMessage mailMsg = (MimeMessage) folder.getMessage(i);
          InOnly io = mef.createInOnlyExchange();
          NormalizedMessage normalizedMessage = io.createMessage();
          this.marshaler.prepareExchange(io,normalizedMessage,mailMsg);
          io.setInMessage(normalizedMessage);
          channel.send(io);
            mailMsg.setFlag(Flags.Flag.DELETED,true);
        }
View Full Code Here

            // send on to the nmr ...
            SyndFeedOutput output = new SyndFeedOutput();
            try {
                Source source = new DOMSource(output.outputW3CDom(feed));
                InOnly exchange = getExchangeFactory().createInOnlyExchange();
                NormalizedMessage message = exchange.createMessage();
                message.setContent(source);
                exchange.setInMessage(message);
                send(exchange);
            }
            catch (Exception e) {
View Full Code Here

            logger.trace("Received: " + jmsMessage);
        }

        try {
            InOnly messageExchange = getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
            NormalizedMessage inMessage = messageExchange.createMessage();

            try {
                marshaler.toNMS(inMessage, jmsMessage);

                messageExchange.setInMessage(inMessage);
View Full Code Here

    public void processInOnly(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException,
            JBIException {
        MessageExchangeFactory factory = getExchangeFactory();
        InOnly exchange = factory.createInOnlyExchange();
        NormalizedMessage inMessage = exchange.createMessage();
        try {
            HttpMarshaler marshaler = getMarshaler();
            marshaler.toNMS(exchange, inMessage, request);
            exchange.setInMessage(inMessage);
            // Do a sendSync so that the stream is not closed
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.