Package javax.jbi.messaging

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


    }

    public void invokeOneWay(ASInvocation invocation, String xml) throws Exception {
        MessageExchangeFactory fac = channel.createExchangeFactory();
        InOnly exchange = fac.createInOnlyExchange();
        NormalizedMessage inMessage = exchange.createMessage();
        marshaler.setContent(inMessage, xml);
        exchange.setInMessage(inMessage);
        channel.send(exchange);
    }
View Full Code Here


    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        logger.trace("Invoked: {}", method);
        try {
            InOnly messageExchange = getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
            NormalizedMessage inMessage = messageExchange.createMessage();
            if( proxy != null )
                inMessage.setProperty("proxy", proxy);
            inMessage.setProperty("method", method);
            if( args!= null )
                inMessage.setProperty("args", args);       
View Full Code Here

            ServiceEndpoint endpoint = endpoints[0];
            LOGGER.info("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>"
View Full Code Here

        if (source == null || !source.booleanValue()) {
            DeliveryChannel channel = getDeliveryChannel();
            InOnly me = channel.createExchangeFactory().createInOnlyExchange();
            // SM-229: Avoid StackOverflowException
            me.setProperty(FROM_SUBSCRIPTION_MANAGER, Boolean.TRUE);
            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

        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

        UMOEvent event = JbiUtils.createEvent(message, this);
        try {
            UMOMessage m = router.route(event);
            if(m!=null) {
                InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
                NormalizedMessage nmessage = exchange.createMessage();

                ServiceEndpoint endpoint = null;
                ServiceEndpoint[] eps = context.getEndpointsForService(targetService);
                if(eps.length==0) {
                    //container should handle this
View Full Code Here

 
  public void testInOnly() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactory(endpoint);
    InOnly mec = mef.createInOnlyExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StreamSource(new ByteArrayInputStream(PAYLOAD.getBytes())));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOnly mep = (InOnly) provider.getChannel().accept(10L);
View Full Code Here

    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactory();
    InOnly me = mef.createInOnlyExchange();
    me.setInterfaceName(new QName("http://www.apache.org/agila/samples/exemple1/definition/", "loanService"));
    me.setOperation(new QName("http://www.apache.org/agila/samples/exemple1/definition/", "request"));
    NormalizedMessage m = me.createMessage();
        Document doc = DocumentHelper.createDocument();
        Element msg = doc.addElement("message");
        msg.addElement("firstName").setText("john");
        msg.addElement("lastName").setText("doe");
        msg.addElement("amount").setText("5000");
View Full Code Here

      }
    }).start();
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactory(endpoint);
    InOnly mec = mef.createInOnlyExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StreamSource(new ByteArrayInputStream(PAYLOAD.getBytes())));
    mec.setInMessage(m);
    consumer.getChannel().sendSync(mec, 10000L);
    assertEquals(ExchangeStatus.DONE, mec.getStatus());
    // Nothing left
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

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.