Interface PluginLoader<T extends Loadable>

Type Parameters:
T - the type of plugin that this loader handles, which extends Loadable
All Known Implementing Classes:
DefaultPluginLoader, ExecutablesPluginLoader, InitializersPluginLoader, LabyrinthPanelsPluginLoader, PluginsLoader, WallStatesPluginLoader

public interface PluginLoader<T extends Loadable>
Defines the contract for plugin loaders that load and manage plugins of type Loadable.

Implementations of this interface are responsible for loading plugins into the system, managing a collection of loaded plugins, and providing access to individual plugins by their identifiers.

Each plugin loader is designed to work with a specific type of Loadable plugin, and ensures that plugins of this type are properly loaded and accessible for the application.

  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves a specific plugin by its unique identifier.
    Returns a list of all loaded plugins.
    void
    Loads all plugins of type T into the system.
  • Method Details

    • loadPlugins

      void loadPlugins()
      Loads all plugins of type T into the system.

      This method is responsible for discovering, loading, and initializing all plugins that are compatible with this loader.

    • getPlugins

      List<T> getPlugins()
      Returns a list of all loaded plugins.

      This method retrieves all plugins that have been successfully loaded by the loader.

      Returns:
      a list of plugins of type T
    • getPlugin

      @Nullable T getPlugin(String id)
      Retrieves a specific plugin by its unique identifier.

      This method allows access to a single plugin by its ID, which is typically the fully qualified class name obtained via Object.getClass().Class.getName(). If the plugin with the specified ID is not found, it returns null.

      Parameters:
      id - the unique identifier for the plugin, usually the fully qualified class name
      Returns:
      the plugin associated with the given ID, or null if not found