Class RequirementSolver

java.lang.Object
de.hybris.bootstrap.util.RequirementSolver

public abstract class RequirementSolver extends Object
Implementation of a sort algorithm for computing the order of dependent objects.
  • Method Details

    • solveParallel

      public static List<List<? extends RequirementHolder>> solveParallel(Collection<? extends RequirementHolder> elements) throws RequirementSolverException
      return a list of list's with tasks that contains either one RequirementHolder or multiple one's, if they can be processed together at a time (which means they have no dependencies between each other) This can be used for parallel computing..
      Throws:
      RequirementSolverException
    • solve

      public static <T extends RequirementHolder> List<T> solve(Collection<T> elements) throws RequirementSolverException
      Sorts the given list of requirements in a manner that honors the given relationships. That is, if project A references project B, then the resulting order will list B before A if possible. For graphs that do not contain cycles, the result is the same as a conventional topological sort.
      Parameters:
      elements - a list of RequirementHolders (e.g.: ExtensionInfo)
      Returns:
      an object describing the resulting order
      Throws:
      RequirementSolverException - if there are cycles detected.