Class URLPluginSetupDescriptor

java.lang.Object
de.iip_ecosphere.platform.support.plugins.URLPluginSetupDescriptor
All Implemented Interfaces:
PluginSetupDescriptor
Direct Known Subclasses:
ClasspathFilePluginSetupDescriptor, FolderClasspathPluginSetupDescriptor, ResourceClasspathPluginSetupDescriptor

public class URLPluginSetupDescriptor extends Object implements PluginSetupDescriptor
Default URL-based plugin setup descriptor. Typically, a specific descriptor inherits from this class and sets up the required information in a constructor without arguments.
Author:
Holger Eichelberger, SSE
  • Field Details

    • urls

      private URL[] urls
  • Constructor Details

    • URLPluginSetupDescriptor

      public URLPluginSetupDescriptor(URL[] urls)
      Creates an URL plugin setup descriptor.
      Parameters:
      urls - the URLs to load classes from
      See Also:
  • Method Details

    • toURL

      public static URL[] toURL(String... urls) throws IllegalArgumentException
      Turns all urls to URL instances.
      Parameters:
      urls - the URLs to convert
      Returns:
      the converted URLs
      Throws:
      IllegalArgumentException - if one of the urls has invalid syntax
    • toURLSafe

      public static URL[] toURLSafe(String... urls)
      Turns all urls to URL instances, logs errors.
      Parameters:
      urls - the URLs to convert
      Returns:
      the converted URLs
      See Also:
    • toURL

      public static URL[] toURL(File... files) throws MalformedURLException
      Turns all files to URL instances.
      Parameters:
      files - the files to convert
      Returns:
      the converted URLs
      Throws:
      MalformedURLException - if one of the urls has invalid syntax
    • toURLSafe

      public static URL[] toURLSafe(File... files)
      Turns all files to URL instances, logs errors.
      Parameters:
      files - the files to convert
      Returns:
      the converted URLs
      See Also:
    • createClassLoader

      public ClassLoader createClassLoader(ClassLoader parent)
      Description copied from interface: PluginSetupDescriptor
      Returns the class loader being responsible for loading the plugin.
      Specified by:
      createClassLoader in interface PluginSetupDescriptor
      Parameters:
      parent - the parent class loader with basic dependencies to use for loading this plugin
      Returns:
      the class loader
    • createClassLoader

      protected ClassLoader createClassLoader(URL[] urls, ClassLoader parent)
      Actually creates the classloader.
      Parameters:
      urls - the URLs to create the classloader from
      parent - the parent class loader
      Returns:
      the created classloader
    • getURLs

      protected URL[] getURLs()
      Returns the URLs.
      Returns:
      the URLs