/** * Create a node processor that will instantiate nodes. It will return nodes whose satisfactions * have been replaced with instance satisfactions containing the instance. * * @return The node processor. */ public static NodeProcessor instantiate() { return instantiate(NodeInstantiator.create()); }
/** * Instantiate the recommender graph. This requires the graph to have been resolved with a real * DAO instance, not just a class, if anything references the DAO. Use {@link * LenskitConfiguration#buildGraph()} to get such a graph. The result of instantiating a graph * is that all shareable nodes will be instantiated. * * @return A new recommender graph with all shareable nodes pre-instantiated. * @throws RecommenderBuildException If there is an error instantiating the graph. */ public DAGNode<Component,Dependency> instantiate() throws RecommenderBuildException { try (LifecycleManager lm = new LifecycleManager()) { NodeInstantiator instantiator = NodeInstantiator.create(lm); // TODO Verify that no sharable components are lifecycle-managed return replaceShareableNodes(NodeProcessors.instantiate(instantiator)); } catch (InjectionException e) { throw new RecommenderBuildException("Recommender instantiation failed", e); } }
/** * Create a node processor that will instantiate nodes. It will return nodes whose satisfactions * have been replaced with instance satisfactions containing the instance. * * @return The node processor. */ public static NodeProcessor instantiate() { return instantiate(NodeInstantiator.create()); }
/** * Instantiate the recommender graph. This requires the graph to have been resolved with a real * DAO instance, not just a class, if anything references the DAO. Use {@link * LenskitConfiguration#buildGraph()} to get such a graph. The result of instantiating a graph * is that all shareable nodes will be instantiated. * * @return A new recommender graph with all shareable nodes pre-instantiated. * @throws RecommenderBuildException If there is an error instantiating the graph. */ public DAGNode<Component,Dependency> instantiate() throws RecommenderBuildException { try (LifecycleManager lm = new LifecycleManager()) { NodeInstantiator instantiator = NodeInstantiator.create(lm); // TODO Verify that no sharable components are lifecycle-managed return replaceShareableNodes(NodeProcessors.instantiate(instantiator)); } catch (InjectionException e) { throw new RecommenderBuildException("Recommender instantiation failed", e); } }