Interface Loader


  • public interface Loader
    An SPI interface for implementing alternative service loading strategies. By default the HTTP framework will use a strategy based on ServiceLoader , but applications may choose to override with their own strategy if needed, for example when running in OSGI environments.
    • Field Detail

      • SERVICE_LOADER

        static final Loader SERVICE_LOADER
        The default Loader implementation used throughout the HTTP framework. This implementation uses ServiceLoader for loading services.
    • Method Detail

      • load

        <S> S load​(Class<S> service,
                   Options options)
        Loads a service of the specified type. Implementations may customize their behavior based on the provided options, e.g. by using a user provided class loader.
        Type Parameters:
        S - The type of service to load.
        Parameters:
        service - The type of service to load.
        options - The user provided options.
        Returns:
        The loaded service, or null if no corresponding service was found.