Package org.servicemix.jbi.jaxp

Examples of org.servicemix.jbi.jaxp.StringSource


    private Map responseProperties;

    public Source getResponseContent() {
        if (responseContent == null) {
            if (responseXml != null) {
                responseContent = new StringSource(responseXml);
            }
            else if (responseResource != null) {
                return new ResourceSource(responseResource);
            }
        }
View Full Code Here


        outputFactory = new WstxOutputFactory();
        inputFactory = new WstxInputFactory();
    }

    public void setContent(NormalizedMessage message, String xml) throws MessagingException {
        message.setContent(new StringSource(xml));
    }
View Full Code Here

    /**
     * @see javax.management.NotificationListener#handleNotification(javax.management.Notification, java.lang.Object)
     */
    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);
View Full Code Here

            NormalizedMessage message = exchange.getInMessage();
            message.setProperty("name", "James");
            message.setProperty("id", new Integer(i));
            message.setProperty("idText", "" + i);
            message.setContent(new StringSource(createMessageXmlText(i)));

            exchange.setService(service);
            client.sendSync(exchange);

            // lets assert that we have no failure
View Full Code Here

    public String getBodyText() throws TransformerException {
        return transformer.toString(getContent());
    }

    public void setBodyText(String xml) {
        setContent(new StringSource(xml));
    }
View Full Code Here

    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        attachments = (Map) in.readObject();
        properties = (Map) in.readObject();
        String src = (String) in.readObject();
        if (src != null) {
            content = new StringSource(src);
        }
    }
View Full Code Here

        if (body instanceof Source) {
            return (Source) body;
        }
        else if (body instanceof String) {
            // lets assume String is the XML to send
            return new StringSource((String) body);
        }
        else if (body instanceof Node) {
            return new DOMSource((Node) body);
        }
        return null;
View Full Code Here

    protected void transformContent(Transformer transformer, MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws TransformerException, MessagingException {
        if (isUseStringBuffer()) {
            StringWriter buffer = new StringWriter();
            Result result = new StreamResult(buffer);
            transformer.transform(in.getContent(), result);
            out.setContent(new StringSource(buffer.toString()));
        }
        else {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            Result result = new StreamResult(buffer);
            transformer.transform(in.getContent(), result);
View Full Code Here

    /**
     * Factory method to turn XML as a String into some POJO which by default
     * will create a {@link StringSource}
     */
    protected Object createXml(String xmlText) {
        return new StringSource(xmlText);
    }
View Full Code Here

            NormalizedMessage message = exchange.getInMessage();
            message.setProperty("name", "James");
            message.setProperty("id", new Integer(i));
            message.setProperty("idText", "" + i);
            message.setContent(new StringSource(createMessageXmlText(i)));

            exchange.setService(service);
            client.sendSync(exchange);
            client.done(exchange);
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.jaxp.StringSource

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.