Class PluginDependencyResolver.MissingDependencyException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.ultikits.ultitools.manager.PluginDependencyResolver.MissingDependencyException
All Implemented Interfaces:
Serializable
Enclosing class:
PluginDependencyResolver

public static class PluginDependencyResolver.MissingDependencyException extends Exception
Exception thrown when required dependencies are missing.

Carries a structured partition alongside the message (D-10): getRefusedPlugins() is the declaring module(s) plus everything that transitively depends on them (#676: softDepends, loadBefore and plugin.yml loadAfter never carry this refusal), plus - when an independent cycle occurs in the same resolve - every remaining module the sort cannot place, refused by the same rule as PluginDependencyResolver.CircularDependencyException. getSortedPrefix() is every other module, in load order; the two are disjoint and together cover every input module. getCyclePaths() names each such cycle and is empty when there is none. The caller obtains all three from these accessors, never by parsing Throwable.getMessage().

A missing dependency takes precedence: when both occur, this exception is thrown, not PluginDependencyResolver.CircularDependencyException.

See Also:
  • Field Details

  • Constructor Details

    • MissingDependencyException

      public MissingDependencyException(String message)
    • MissingDependencyException

      public MissingDependencyException(String message, List<Class<? extends UltiToolsPlugin>> sortedPrefix, Set<String> refusedPlugins)
      Constructs a missing-hard-dependency refusal carrying the structured partition and no cycle paths.
      Parameters:
      message - the human-readable detection message, naming the declaring module(s) and the dependency each wanted
      sortedPrefix - every plugin class that survives, in load order
      refusedPlugins - every refused plugin, by plugin name
      Since:
      6.3.0
    • MissingDependencyException

      public MissingDependencyException(String message, List<Class<? extends UltiToolsPlugin>> sortedPrefix, Set<String> refusedPlugins, List<List<String>> cyclePaths)
      Constructs a missing-hard-dependency refusal that also carries the paths of independent cycles found among the modules the missing dependency did not refuse.
      Parameters:
      message - the human-readable detection message, naming the declaring module(s), the dependency each wanted and, when cycles exist, the modules they block
      sortedPrefix - every plugin class that survives, in load order
      refusedPlugins - every refused plugin, by plugin name: the depends closure of the declaring modules plus every module the sort could not place
      cyclePaths - each detected cycle as an ordered list of plugin names whose first and last entries are the same node; empty when there is none
      Since:
      6.3.0
  • Method Details

    • getSortedPrefix

      public List<Class<? extends UltiToolsPlugin>> getSortedPrefix()
      The plugin classes that survive, in load order: every module neither in the depends closure of a module with a missing hard dependency nor blocked by a cycle. Never null.
      Returns:
      the sortable prefix
      Since:
      6.3.0
    • getRefusedPlugins

      public Set<String> getRefusedPlugins()
      The declaring module(s), every plugin that transitively depends on them, and every module an independent cycle blocks, by plugin name. Never null.
      Returns:
      the refused plugin names
      Since:
      6.3.0
    • getCyclePaths

      public List<List<String>> getCyclePaths()
      Each independent cycle found in the same resolve, as an ordered list of plugin names whose first and last entries are the same node, e.g. [A, B, A]. Never null; empty when the only failure is a missing dependency.
      Returns:
      the detected cycle paths
      Since:
      6.3.0