Package javax.jbi.messaging

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


     * @throws JBIException
     */
    protected void dispatchToSubscriber(MessageExchangeImpl exchange, InternalEndpoint endpoint) throws JBIException {
        DeliveryChannel channel = getDeliveryChannel();
        InOnly me = channel.createExchangeFactory().createInOnlyExchange();
        NormalizedMessage in = me.createMessage();
        getMessageTransformer().transform(me, exchange.getInMessage(), in);
        me.setInMessage(in);
        me.setEndpoint(endpoint);
        Set names = exchange.getPropertyNames();
        for (Iterator iter = names.iterator(); iter.hasNext();) {
View Full Code Here


        container.activateComponent(activationSpec);
    }

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

    public InOnly createInOnlyExchange(EndpointResolver resolver) throws JBIException {
View Full Code Here

        container.activateComponent(activationSpec);
    }

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

    public InOnly createInOnlyExchange(EndpointResolver resolver) throws JBIException {
View Full Code Here

        QName service = getQNameAttribute(namespaceContext, element, "service");
        QName interfaceName = getQNameAttribute(namespaceContext, element, "interface");
        QName operation = getQNameAttribute(namespaceContext, element, "operation");

        InOnly outExchange = component.createInOnlyExchange(service, interfaceName, operation);
        NormalizedMessage out = outExchange.createMessage();
        outExchange.setInMessage(out);

        transformer.setParameter("out", out);

        // lets copy the content into the body
View Full Code Here

        this.exchangeFactory = deliveryChannel.createExchangeFactory(endpoint);
    }

    protected void dispatchMessage(TopicExpressionType topic, Message message) throws MessagingException, JMSException {
        InOnly exchange = exchangeFactory.createInOnlyExchange();
        NormalizedMessage in = exchange.createMessage();
        in.setProperty(TOPIC_NAME, topic);
        in.setContent(createContent(topic, message));
        exchange.setInMessage(in);
        appendHeaders(exchange, topic, message);
        deliveryChannel.send(exchange);
View Full Code Here

    }
    try {
      QName targetInterface = new QName("http://tempuri.org/quartz",
          "triggeredNotification");
      InOnly inOnly = serviceContext.createInOnly(targetInterface);
      NormalizedMessage message = inOnly.createMessage();
      getMarshaler().populateNormalizedMessage(message, context);
      inOnly.setInMessage(message);
      serviceContext.done(inOnly);
    } catch (MessagingException e) {
      throw new JobExecutionException(e);
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

    public void sendMessages(int messageCount, boolean sync) throws JBIException {
        ComponentContext context = getContext();

        for (int i = 0; i < messageCount; i++) {
            InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
            NormalizedMessage message = exchange.createMessage();

            ServiceEndpoint destination = null;
            if (resolver != null) {
                destination = resolver.resolveEndpoint(getContext(), exchange, NullEndpointFilter.getInstance());
            }
View Full Code Here

            ServiceEndpoint endpoint = endpoints[0];
            System.out.println("Sending to endpoint: " + endpoint);
           
            for (int i = 0; i < messageCount; i++) {
                InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
                NormalizedMessage message = exchange.createMessage();
                exchange.setEndpoint(endpoint);
                exchange.setInMessage(message);
                // lets set the XML as a byte[], String or DOM etc
                String xml = "<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'><s12:Body> <foo>Hello!</foo> </s12:Body></s12:Envelope>";
                message.setContent(new StringSource(xml));
View Full Code Here

 
  public void testInOnly() 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);
        assertEquals(Role.CONSUMER, mec.getRole());
        try {
            mec.setMessage(null, "in");
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.