Class PluginLoader

  • All Implemented Interfaces:
    AutoCloseable

    @ThreadSafe
    public class PluginLoader
    extends Object
    implements AutoCloseable
    A PluginLoader is used by the PluginManager to load a single plugin. It is essentially a combination of a PluginLoader.PluginClassLoader and ServiceLoader. This class can locate and load service implementations from the plugin for a given SPI. The PluginDescriptor, which among other information contains the resource URLs, is provided at construction.
    • Method Detail

      • load

        public <P> Iterator<P> load​(Class<P> service)
        Returns in iterator over all available implementations of the given service interface (SPI) for the plugin.
        Type Parameters:
        P - Type of the requested plugin service.
        Parameters:
        service - the service interface (SPI) for which implementations are requested.
        Returns:
        An iterator of all implementations of the given service interface that could be loaded from the plugin.