com.sun.xml.internal.ws.encoding.xml.XMLMessage.MessageDataSource Java Examples

The following examples show how to use com.sun.xml.internal.ws.encoding.xml.XMLMessage.MessageDataSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XMLHTTPBindingCodec.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #2
Source File: XMLHTTPBindingCodec.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #3
Source File: XMLHTTPBindingCodec.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #4
Source File: XMLHTTPBindingCodec.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #5
Source File: XMLHTTPBindingCodec.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #6
Source File: XMLHTTPBindingCodec.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #7
Source File: XMLHTTPBindingCodec.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #8
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #9
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #10
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #11
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #12
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #13
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #14
Source File: XMLHTTPBindingCodec.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #15
Source File: XMLHTTPBindingCodec.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private ContentType encode(MessageDataSource mds, OutputStream out) {
    try {
        final boolean isFastInfoset = XMLMessage.isFastInfoset(
                mds.getDataSource().getContentType());
        DataSource ds = transformDataSource(mds.getDataSource(),
                isFastInfoset, useFastInfosetForEncoding, features);

        InputStream is = ds.getInputStream();
        byte[] buf = new byte[1024];
        int count;
        while((count=is.read(buf)) != -1) {
            out.write(buf, 0, count);
        }
        return new ContentTypeImpl(ds.getContentType());
    } catch(IOException ioe) {
        throw new WebServiceException(ioe);
    }
}
 
Example #16
Source File: XMLHTTPBindingCodec.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ContentType getStaticContentType(Packet packet) {
    ContentType ct;
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource()) {
            ct = getStaticContentType(mds);
            return (ct != null)
                ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
                : null;
        }
    }

    ct = super.getStaticContentType(packet);
    return (ct != null)
        ? setAcceptHeader(packet, ct) //_adaptingContentType.set(packet, ct)
        : null;
}
 
Example #17
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #18
Source File: XMLHTTPBindingCodec.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #19
Source File: XMLHTTPBindingCodec.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource())
            return setAcceptHeader(packet, encode(mds, out));
    }

    return setAcceptHeader(packet, super.encode(packet, out));
}
 
Example #20
Source File: XMLHTTPBindingCodec.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource())
            return setAcceptHeader(packet, encode(mds, out));
    }

    return setAcceptHeader(packet, super.encode(packet, out));
}
 
Example #21
Source File: XMLHTTPBindingCodec.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #22
Source File: XMLHTTPBindingCodec.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #23
Source File: XMLHTTPBindingCodec.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource())
            return setAcceptHeader(packet, encode(mds, out));
    }

    return setAcceptHeader(packet, super.encode(packet, out));
}
 
Example #24
Source File: XMLHTTPBindingCodec.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #25
Source File: XMLHTTPBindingCodec.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource())
            return setAcceptHeader(packet, encode(mds, out));
    }

    return setAcceptHeader(packet, super.encode(packet, out));
}
 
Example #26
Source File: XMLHTTPBindingCodec.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource())
            return setAcceptHeader(packet, encode(mds, out));
    }

    return setAcceptHeader(packet, super.encode(packet, out));
}
 
Example #27
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #28
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if (packet.getInternalMessage() instanceof MessageDataSource) {
        final MessageDataSource mds = (MessageDataSource)packet.getInternalMessage();
        if (mds.hasUnconsumedDataSource())
            return setAcceptHeader(packet, encode(mds, out));
    }

    return setAcceptHeader(packet, super.encode(packet, out));
}
 
Example #29
Source File: XMLHTTPBindingCodec.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}
 
Example #30
Source File: XMLHTTPBindingCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private ContentType getStaticContentType(MessageDataSource mds) {
    final String contentType = mds.getDataSource().getContentType();
    final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);

    if (!requiresTransformationOfDataSource(isFastInfoset,
            useFastInfosetForEncoding)) {
        return new ContentTypeImpl(contentType);
    } else {
        return null;
    }
}