Class DependencyProvider

java.lang.Object
org.veupathdb.lib.container.jaxrs.providers.DependencyProvider

public class DependencyProvider extends Object
  • Method Details

    • lookup

      public Optional<Dependency> lookup(String name)
      Attempts to fetch a dependency by name.
      Returns:
      An option that will be empty if no dependency was found with the given name.
    • has

      public boolean has(String name)
      Returns whether there is a dependency registered with the given name.
    • register

      public void register(Dependency dep)
      Register a new dependency.
    • closeAndRemove

      public void closeAndRemove(String name) throws Exception
      Removes and closes the dependency with the given name.

      If no dependency was found with the given name, this method does nothing.

      Throws:
      Exception
    • registerDependencySource

      public void registerDependencySource(DependencySource source)
      Registers a source of extra or ephemeral dependencies that should not or cannot be registered normally.
      Parameters:
      source - Extra dependency source.
    • testDependencies

      public List<Dependency.TestResult> testDependencies()
      Runs the test method on all currently registered dependencies and returns a map of the test results keyed on dependency name.
    • shutDown

      public void shutDown()
      Attempts to shut down all dependencies currently registered.
    • getInstance

      public static DependencyProvider getInstance()