Package javax.jbi.messaging

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


            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


    protected void processFile(FTPClient client, FTPFile file) throws Exception {
        String name = file.getName();
        InputStream in = client.retrieveFileStream(getWorkingPath() + name);
        client.completePendingCommand();
        InOnly exchange = getExchangeFactory().createInOnlyExchange();
        NormalizedMessage message = exchange.createMessage();
        exchange.setInMessage(message);
        marshaler.readMessage(exchange, message, in, name);
        getDeliveryChannel().sendSync(exchange);
        in.close();
    }
View Full Code Here

    protected void processFile(File aFile) throws Exception {
        String name = aFile.getCanonicalPath();
        InputStream in = new BufferedInputStream(new FileInputStream(aFile));
        InOnly exchange = getExchangeFactory().createInOnlyExchange();
        NormalizedMessage message = exchange.createMessage();
        exchange.setInMessage(message);
        marshaler.readMessage(exchange, message, in, name);
        getDeliveryChannel().sendSync(exchange);
        in.close();
    }
View Full Code Here

        if (log.isTraceEnabled()) {
            log.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

    private SaajMarshaler marshaler = new SaajMarshaler();

    public void onSoapMessage(SOAPMessage soapMesssage) {
        try {
            InOnly messageExchange = createMessageExchange();
            NormalizedMessage inMessage = messageExchange.createMessage();

            try {
                marshaler.toNMS(inMessage, soapMesssage);

                messageExchange.setInMessage(inMessage);
View Full Code Here

        InputStream in = file.getContent().getInputStream();
        if (in == null) {
            throw new JBIException("No input available for file!");
        }
        InOnly exchange = getExchangeFactory().createInOnlyExchange();
        NormalizedMessage message = exchange.createMessage();
        exchange.setInMessage(message);
        marshaler.readMessage(exchange, message, in, name);
        getDeliveryChannel().sendSync(exchange);
        in.close();
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Firing Quartz Job with context: " + context);
        }
        try {
            InOnly exchange = getExchangeFactory().createInOnlyExchange();
            NormalizedMessage message = exchange.createMessage();
            getMarshaler().populateNormalizedMessage(message, context);
            exchange.setInMessage(message);
            send(exchange);
        }
        catch (MessagingException e) {
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

     */
    public void handleNotification(Notification notification,Object arg1){
        try {
            Source source = new StringSource(notification.getMessage());
            InOnly exchange = getExchangeFactory().createInOnlyExchange();
            NormalizedMessage message = exchange.createMessage();
            message.setContent(source);
            exchange.setInMessage(message);
            done(exchange);
        }
        catch (Exception e) {
View Full Code Here

    }

    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

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.