Class YAAC.PluginContext

java.lang.Object
org.ka2ddo.yaac.YAAC.PluginContext
All Implemented Interfaces:
Comparable<YAAC.PluginContext>
Enclosing class:
YAAC

public static class YAAC.PluginContext extends Object implements Comparable<YAAC.PluginContext>
Support class for loading plugins that may have circular dependencies.
Author:
Andrew Pavlin, KA2DDO
  • Method Details

    • compareTo

      public int compareTo(YAAC.PluginContext pluginContext)
      Specify in what order plugins should be loaded. Plugins are initially sorted in the timestamp of the plugin JAR files; however, dependencies between plugins may require that order to be changed so that the classpath has independent plugins before the other plugins that depend on them.
      Specified by:
      compareTo in interface Comparable<YAAC.PluginContext>
      Parameters:
      pluginContext - PluginContext to compare against this PluginContext
      Returns:
      -1 if this PluginContext should be before the other PluginContext, +1 if this PluginContext should be after the other PluginContext, or 0 if the relative order of these two PluginContext objectd doesn't matter
    • getPluginName

      public String getPluginName()
      Get the name of the plugin JAR file.
      Returns:
      plugin name
    • getProviderClassName

      public String getProviderClassName()
      Get the fully package qualified class name of the Provider subclass for this plugin.
      Returns:
      String name of Provider subclass
    • getPluginURLs

      public URL[] getPluginURLs()
      Get array of jar URLs for this plugin, including any 3rd-party library JARs this plugin depends on.
      Returns:
      String array of plugin JAR URL strings
    • getPrerequisiteSet

      public Set<String> getPrerequisiteSet()
      Get the set of plugin names of the other plugins this plugin depends on. The CoreProvider does not have to be specified, since it will always be before all plugin JAR files on the classpath.
      Returns:
      Set of other plugin names
    • toString

      public String toString()
      Return a string representing this object.
      Overrides:
      toString in class Object
      Returns:
      String describing this PluginContext object