Class DefaultPluginDescriptor<T>

java.lang.Object
de.iip_ecosphere.platform.support.plugins.DefaultPluginDescriptor<T>
Type Parameters:
T - plugin type
All Implemented Interfaces:
PluginDescriptor<T>
Direct Known Subclasses:
SingletonPluginDescriptor

public class DefaultPluginDescriptor<T> extends Object implements PluginDescriptor<T>
Default plugin descriptor implementation. May create per calling createPlugin(File) always a new instance.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

  • Method Details

    • initPluginSupplier

      protected DefaultPluginDescriptor.PluginSupplier<T> initPluginSupplier(DefaultPluginDescriptor.PluginSupplier<T> pluginSupplier)
      Returns the plugin supplier upon creation. May override the provided supplier, in particular if the result refers to this, which is not available in the super call of a constructor.
      Parameters:
      pluginSupplier - the supplied supplier
      Returns:
      pluginSupplier
    • initPluginClass

      protected Class<T> initPluginClass(Class<T> pluginClass)
      Returns the plugin class upon creation. May override the provided class, in particular if the result refers to this or Object.getClass(), which is not available in the super call of a constructor.
      Parameters:
      pluginSupplier - the supplied supplier
      Returns:
      pluginSupplier
    • initId

      protected String initId(String id)
      Returns the plugin id upon creation. May override the provided id.
      Parameters:
      id - the supplied plugin id
      Returns:
      id
    • initIds

      protected List<String> initIds(List<String> ids)
      Returns the additional plugin ids upon creation.
      Parameters:
      ids - the supplied plugin ids
      Returns:
      ids
    • getFurtherIds

      public List<String> getFurtherIds()
      Description copied from interface: PluginDescriptor
      Returns further ids this plugin represents.
      Specified by:
      getFurtherIds in interface PluginDescriptor<T>
      Returns:
      the further ids, may be null, empty, unmodifiable
    • getId

      public String getId()
      Description copied from interface: PluginDescriptor
      Returns the unique/primary plugin id.
      Specified by:
      getId in interface PluginDescriptor<T>
      Returns:
      the id
    • createPlugin

      public Plugin<T> createPlugin(File installDir)
      Description copied from interface: PluginDescriptor
      Creates a plugin instance.
      Specified by:
      createPlugin in interface PluginDescriptor<T>
      Parameters:
      installDir - the installation directory, may be null
      Returns:
      the plugin instance
    • createPlugin

      protected Plugin<T> createPlugin(String id, List<String> ids, Class<T> pluginClass, DefaultPluginDescriptor.PluginSupplier<T> pluginSupplier, File installDir)
      Creates the plugin instance.
      Parameters:
      id - the plugin id
      ids - optional secondary ids, may be null or empty
      pluginClass - the instance class
      pluginSupplier - the creator supplier
      installDir - the installation directory, may be null
      Returns:
      the plugin instance
    • getType

      public Class<T> getType()
      Description copied from interface: PluginDescriptor
      Returns the type of plugin being created.
      Specified by:
      getType in interface PluginDescriptor<T>
      Returns: