Package javax.jbi.messaging

Examples of javax.jbi.messaging.MessageExchangeFactory


            super(SERVICE, ENDPOINT);
        }

        public void sendMessages(int nb, boolean stateless) throws Exception {
            for (int i = 0; i < nb; i++) {
                MessageExchangeFactory mef = getDeliveryChannel().createExchangeFactory();
                InOut me = mef.createInOutExchange();
                me.setService(new QName("echo"));
                if (stateless) {
                    me.setProperty(JbiConstants.STATELESS_CONSUMER, Boolean.TRUE);
                }
                me.setInMessage(me.createMessage());
View Full Code Here


        // Retrieve a delivery channel
        TestComponent component = new TestComponent(null, null);
        container.activateComponent(new ActivationSpec("component", component));
        DeliveryChannel channel = component.getChannel();
        // test
        MessageExchangeFactory mef = channel.createExchangeFactory();
        assertNotNull(mef);
        assertNotNull(mef.createInOnlyExchange());
    }
View Full Code Here

        TestComponent component = new TestComponent(null, null);
        container.activateComponent(new ActivationSpec("component", component));
        DeliveryChannel channel = component.getChannel();
        // test
        channel.close();
        MessageExchangeFactory mef = channel.createExchangeFactory();
        assertNotNull(mef);
        try {
            mef.createInOnlyExchange();
            fail("Exchange creation should have failed (JBI: 5.5.2.1.4)");
        } catch (MessagingException e) {
            // expected
        }
    }
View Full Code Here

                }
            }
        };
        t.start();

        MessageExchangeFactory factory = channel.createExchangeFactoryForService(new QName("service"));
        InOut me = factory.createInOutExchange();
        NormalizedMessage nm = me.createMessage();
        nm.setContent(new StringSource("<request/>"));
        me.setInMessage(nm);
        channel.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
View Full Code Here

            t.join();
        }
    }
   
    private MessageExchangeImpl createMessageExchange(final DeliveryChannelImpl channel) throws MessagingException {
        MessageExchangeFactory factory = channel.createExchangeFactoryForService(new QName("service"));   
        return (MessageExchangeImpl) factory.createInOutExchange();
    }
View Full Code Here

            DescriptorEndpointInfo dei = EndpointRegistry.getInstance().getJBIEndpts().get(key);
            QName service = (dei == null)? this.service:dei.getServiceName();
            String endpointName = (dei == null)? this.endpointName:dei.getEndpointName();

            // Create MessageExchange
            MessageExchangeFactory factory =
                    channel.createExchangeFactoryForService(service);
            me =  oneWay ? factory.createInOnlyExchange() : factory.createInOutExchange();
            me.setService(service);
            ComponentContext context = JavaEEServiceEngineContext.getInstance().getJBIContext();
            me.setEndpoint(context.getEndpoint(service, endpointName));
            me.setOperation(operation);
            meTransport = MessageExchangeTransportFactory.getHandler(me);
View Full Code Here

      AgilaComponent component = AgilaComponent.getInstance();
      if (component == null) {
        throw new IllegalStateException("AgilaComponent is not initialized");
      }
      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(portType));
      me.setOperation(new QName(operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
View Full Code Here

      AgilaComponent component = AgilaComponent.getInstance();
      if (component == null) {
        throw new IllegalStateException("AgilaComponent is not initialized");
      }
      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(namespace, portType));
      me.setOperation(new QName(namespace, operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
View Full Code Here

      AgilaComponent component = AgilaComponent.getInstance();
      if (component == null) {
        throw new IllegalStateException("AgilaComponent is not initialized");
      }
      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(portType));
      me.setOperation(new QName(operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
View Full Code Here

      AgilaComponent component = AgilaComponent.getInstance();
      if (component == null) {
        throw new IllegalStateException("AgilaComponent is not initialized");
      }
      DeliveryChannel channel = component.getContext().getDeliveryChannel();
      MessageExchangeFactory mef = channel.createExchangeFactory();
      MessageExchange me = mef.createInOnlyExchange();
      me.setInterfaceName(new QName(namespace, portType));
      me.setOperation(new QName(namespace, operation));
      NormalizedMessage in = me.createMessage();
      in.setContent(new DocumentSource(message));
      me.setMessage(in, "in");
View Full Code Here

TOP

Related Classes of javax.jbi.messaging.MessageExchangeFactory

Copyright © 2018 www.massapicom. 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.