pool = MergePool.create();
/** * Create a DependencySolver that uses the given functions, and max * depth of the dependency graph. * * @param bindFunctions The binding functions that control desire bindings * @param maxDepth A maximum depth of the graph before it's determined that * a cycle exists * @throws IllegalArgumentException if maxDepth is less than 1 * @throws NullPointerException if bindFunctions is null */ DependencySolver(List<BindingFunction> bindFunctions, List<BindingFunction> triggers, CachePolicy defaultPolicy, int maxDepth) { Preconditions.notNull("bindFunctions", bindFunctions); Preconditions.notNull("defaultPolicy", defaultPolicy); if (maxDepth <= 0) { throw new IllegalArgumentException("Max depth must be at least 1"); } this.functions = new ArrayList<BindingFunction>(bindFunctions); this.triggerFunctions = new ArrayList<BindingFunction>(triggers); this.maxDepth = maxDepth; this.defaultPolicy = defaultPolicy; graph = DAGNode.singleton(ROOT_SATISFACTION); backEdges = HashMultimap.create(); mergePool = MergePool.create(); logger.info("DependencySolver created, max depth: {}", maxDepth); }
MergePool<Component,Dependency> pool = MergePool.create(); pool.merge(graph); return pool.merge(stage2);
MergePool<Component,Dependency> pool = null; if (cache != null) { pool = MergePool.create();