Interface PagedMediaWriterFactoryService


  • public interface PagedMediaWriterFactoryService

    Provides an interface for a PagedMediaWriterFactory service. The purpose of this interface is to expose an implementation of a PagedMediaWriterFactory as a service.

    To comply with this interface, an implementation must be thread safe and address both the possibility that only a single instance is created and used throughout and that new instances are created as desired.

    • Method Detail

      • supportsMediaType

        boolean supportsMediaType​(String mediaType)
        Returns true if this instance can create instances for the specified mediaType.
        Parameters:
        mediaType - a valid Internet media type
        Returns:
        returns true if the specified locale is supported, false otherwise
      • listMediaTypes

        Collection<String> listMediaTypes()
        Lists supported media types.
        Returns:
        returns a list of supported media types
      • newFactory

        PagedMediaWriterFactory newFactory​(String mediaType)
        Creates a new paged media writer factory for the specified media type.
        Parameters:
        mediaType - the media type.
        Returns:
        returns a new factory
      • setCreatedWithSPI

        default void setCreatedWithSPI()

        Informs the implementation that it was discovered and instantiated using information collected from a file within the META-INF/services directory. In other words, it was created using SPI (service provider interfaces).

        This information, in turn, enables the implementation to use the same mechanism to set dependencies as needed.

        If this information is not given, an implementation should avoid using SPIs and instead use declarative services for dependency injection as specified by OSGi. Note that this also applies to several newInstance() methods in the Java API.

        The class that created an instance with SPI must call this method before putting it to use.