Package org.apache.cxf.attachment

Examples of org.apache.cxf.attachment.CachedOutputStream


    }

    public Object read(QName name, XMLStreamReader input, Class type) {
        if (SAXSource.class.isAssignableFrom(type)) {
            try {
                CachedOutputStream out = new CachedOutputStream();
                XMLStreamWriter xsw = StaxUtils.createXMLStreamWriter(out);
                StaxUtils.copy(input, xsw);
                xsw.close();
                out.close();
               
                return new SAXSource(new InputSource(out.getInputStream()));
            } catch (IOException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            } catch (XMLStreamException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            }
        } else if (StreamSource.class.isAssignableFrom(type)) {
            try {
                CachedOutputStream out = new CachedOutputStream();
                XMLStreamWriter xsw = StaxUtils.createXMLStreamWriter(out);
                StaxUtils.copy(input, xsw);
                xsw.close();
                out.close();
               
                return new StreamSource(out.getInputStream());
            } catch (IOException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            } catch (XMLStreamException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            }
View Full Code Here


    }

    public Object read(QName name, Node input, Class type) {
        if (SAXSource.class.isAssignableFrom(type)) {
            try {
                CachedOutputStream out = new CachedOutputStream();
                DOMUtils.writeXml(input, out);
               
                return new SAXSource(new InputSource(out.getInputStream()));
            } catch (IOException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            } catch (TransformerException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            }
        } else if (StreamSource.class.isAssignableFrom(type)) {
            try {
                CachedOutputStream out = new CachedOutputStream();
                DOMUtils.writeXml(input, out);
                out.close();
               
                return new StreamSource(out.getInputStream());
            } catch (IOException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            } catch (TransformerException e) {
                throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
            }
View Full Code Here

                ex.put(IN_EXCHANGE, exchange);
                destination.getMessageObserver().onMessage(inMsg);
            }
        };

        final AbstractCachedOutputStream outStream = new CachedOutputStream(stream);

        message.setContent(OutputStream.class, outStream);

        // TODO: put on executor
        new Thread(receiver).start();
View Full Code Here

                ex.put(IN_EXCHANGE, exchange);
                destination.getMessageObserver().onMessage(m);
            }
        };

        final AbstractCachedOutputStream outStream = new CachedOutputStream(stream);

        message.setContent(OutputStream.class, outStream);

        // TODO: put on executor
        new Thread(receiver).start();
View Full Code Here

TOP

Related Classes of org.apache.cxf.attachment.CachedOutputStream

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.