Class Plugins


  • public class Plugins
    extends java.lang.Object
    This class loads and manages all the Plugins loaded in the classpath. It provides two public methods:
    • list() returns a list of all loaded plugins (as per classpath)
    • get() returns a specific plugin, defined by a name
    See Also:
    Plugin
    • Constructor Summary

      Constructors 
      Constructor Description
      Plugins()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Plugin get​(java.lang.String pluginId)
      Loads the Plugin by a given identifier.
      static <T extends Plugin>
      T
      get​(java.lang.String pluginId, java.lang.Class<T> pluginClass)  
      static java.util.List<Plugin> list()
      Loads and returns a list of all available Plugins.
      static <T extends Plugin>
      java.util.List<T>
      list​(java.lang.Class<T> pluginClass)
      Loads and returns a list of all Plugins matching the given subclass.
      static void refresh()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • list

        public static java.util.List<Pluginlist()
        Loads and returns a list of all available Plugins.
      • list

        public static <T extends Plugin> java.util.List<T> list​(java.lang.Class<T> pluginClass)
        Loads and returns a list of all Plugins matching the given subclass.
      • get

        public static Plugin get​(java.lang.String pluginId)
        Loads the Plugin by a given identifier.

        Note: Unlike the list() method, this method is not expected to take long, because there is no need to read all JARs in the classpath.

        Parameters:
        pluginId - Identifier of the plugin, as defined by the plugin ID
        Returns:
        Returns an instance of a plugin, or null if no plugin with the given identifier can be found
      • get

        public static <T extends Plugin> T get​(java.lang.String pluginId,
                                               java.lang.Class<T> pluginClass)
      • refresh

        public static void refresh()