Class StreamingResponseProvider

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyWriter<StreamingResponse>

    @Provider
    public class StreamingResponseProvider
    extends Object
    implements javax.ws.rs.ext.MessageBodyWriter<StreamingResponse>
    Adds support for StreamingResponse entities on Responses.

    This provider is registered with JAX-RS via an entry in services/javax.ws.rs.ext.MessageBodyWriter under META-INF.

    When writers are registered as part of Jersey's startup, the per-media-type mapping is sorted by how far the type parameter is from Object. This encourages Jersey to choose more specialized writers over generic ones. JacksonJaxbJsonProvider is MessageBodyWriter&lt;Object&gt;, so this writer always sorts before it in the list. That means, as long as the type being written implements StreamingResponse, this writer will be chosen to write it.

    Since:
    9.4.0
    • Constructor Detail

      • StreamingResponseProvider

        public StreamingResponseProvider()
    • Method Detail

      • isWriteable

        public boolean isWriteable​(Class<?> type,
                                   Type genericType,
                                   Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<StreamingResponse>