Interface PluginManager


  • public interface PluginManager
    Manages plugins loaded on the proxy. This manager can retrieve PluginContainers from plugin instances and inject arbitrary JAR files into the plugin classpath with addToClasspath(Object, Path).
    • Method Detail

      • fromInstance

        java.util.Optional<PluginContainer> fromInstance​(java.lang.Object instance)
        Gets the plugin container from an instance.
        Parameters:
        instance - the instance
        Returns:
        the container
      • getPlugin

        java.util.Optional<PluginContainer> getPlugin​(java.lang.String id)
        Retrieves a PluginContainer based on its ID.
        Parameters:
        id - the plugin ID
        Returns:
        the plugin, if available
      • isLoaded

        boolean isLoaded​(java.lang.String id)
        Checks if a plugin is loaded based on its ID.
        Parameters:
        id - the id of the plugin
        Returns:
        true if loaded
      • addToClasspath

        void addToClasspath​(java.lang.Object plugin,
                            java.nio.file.Path path)
        Adds the specified path to the plugin classpath.
        Parameters:
        plugin - the plugin
        path - the path to the JAR you want to inject into the classpath
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not applicable to this plugin