Class AbstractConfigurableProvider

    • Constructor Detail

      • AbstractConfigurableProvider

        public AbstractConfigurableProvider()
    • Method Detail

      • setBus

        public void setBus​(org.apache.cxf.Bus b)
        Sets the Bus
        Parameters:
        b -
      • getBus

        public org.apache.cxf.Bus getBus()
        Gets the Bus. Providers may use the bus to resolve resource references. Example: ResourceUtils.getResourceStream(reference, this.getBus())
        Returns:
      • setConsumeMediaTypes

        public void setConsumeMediaTypes​(List<String> types)
        Sets custom Consumes media types; can be used to override static Consumes annotation value set on the provider.
        Parameters:
        types - the media types
      • getConsumeMediaTypes

        public List<String> getConsumeMediaTypes()
        Gets the custom Consumes media types
        Returns:
        media types
      • setProduceMediaTypes

        public void setProduceMediaTypes​(List<String> types)
        Sets custom Produces media types; can be used to override static Produces annotation value set on the provider.
        Parameters:
        types - the media types
      • getProduceMediaTypes

        public List<String> getProduceMediaTypes()
        Gets the custom Produces media types
        Returns:
        media types
      • setEnableBuffering

        public void setEnableBuffering​(boolean enableBuf)
        Enables the buffering mode. If set to true then the runtime will ensure that the provider writes to a cached stream. For example, the JAXB marshalling process may fail after the initial XML tags have already been written out to the HTTP output stream. Enabling the buffering ensures no incomplete payloads are sent back to clients in case of marshalling errors at the cost of the initial buffering - which might be negligible for small payloads.
        Parameters:
        enableBuf - the value of the buffering mode, false is default.
      • getEnableBuffering

        public boolean getEnableBuffering()
        Gets the value of the buffering mode
        Returns:
        true if the buffering is enabled
      • setEnableStreaming

        public void setEnableStreaming​(boolean enableStream)
        Enables the support for streaming. XML-aware providers which prefer writing to Stax XMLStreamWriter can set this value to true. Additionally, if the streaming and the buffering modes are enabled, the runtime will ensure the XMLStreamWriter events are cached properly.
        Parameters:
        enableStream - the value of the streaming mode, false is default.
      • getEnableStreaming

        public boolean getEnableStreaming()
        Gets the value of the streaming mode
        Returns:
        true if the streaming is enabled
      • init

        public void init​(List<ClassResourceInfo> resources)
        Gives providers a chance to introspect the JAX-RS model classes. For example, the JAXB provider may use the model classes to create a single composite JAXBContext supporting all the JAXB-annotated root resource classes/types.
        Parameters:
        resources -
      • isPayloadEmpty

        protected boolean isPayloadEmpty​(javax.ws.rs.core.HttpHeaders headers)
      • isPayloadEmpty

        protected boolean isPayloadEmpty​(javax.ws.rs.core.MultivaluedMap<String,​String> headers)
      • reportEmptyContentLength

        protected void reportEmptyContentLength()
                                         throws javax.ws.rs.core.NoContentException
        Throws:
        javax.ws.rs.core.NoContentException