Interface DependencyContext


@Internal public interface DependencyContext
A dependency context is a read-only abstraction of a type/concept that can resolve dependencies between plugins.

This may for example be the server wide plugin manager itself, capable of validating if a dependency exists between two PluginMeta instances, however the implementation is not limited to such a concrete use-case.

  • Method Details

    • isTransitiveDependency

      boolean isTransitiveDependency(@NotNull @NotNull PluginMeta plugin, @NotNull @NotNull PluginMeta depend)
      Computes if the passed PluginMeta defined the passed dependency as a transitive dependency. A transitive dependency, as implied by its name, may not have been configured directly by the passed plugin but could also simply be a dependency of a dependency.

      A simple example of this method would be

      
       dependencyContext.isTransitiveDependency(pluginMetaA, pluginMetaC);
       
      which would return true if pluginMetaA directly or indirectly depends on pluginMetaC.
      Parameters:
      plugin - the plugin meta this computation should consider the requester of the dependency status for the passed potential dependency.
      depend - the potential transitive dependency of the plugin parameter.
      Returns:
      a simple boolean flag indicating if plugin considers depend as a transitive dependency.
    • hasDependency

      boolean hasDependency(@NotNull @NotNull String pluginIdentifier)
      Computes if this dependency context is aware of a dependency that provides/matches the passed identifier.

      A dependency in this methods context is any dependable artefact. It does not matter if anything actually depends on said artefact, its mere existence as a potential dependency is enough for this method to consider it a dependency. If this dependency context is hence aware of an artefact with the matching identifier, this method returns true.

      Parameters:
      pluginIdentifier - the unique identifier of the dependency with which to probe this dependency context.
      Returns:
      a plain boolean flag indicating if this dependency context is aware of a potential dependency with the passed identifier.