public class InjectionContainer extends Object
CachePolicy.MEMOIZE
will share an instance so long
as they are instantiated by the same instantiator.Modifier and Type | Method and Description |
---|---|
static InjectionContainer |
create()
Create a new instantiator with a default policy of
MEMOIZE . |
static InjectionContainer |
create(CachePolicy dft)
Create a new instantiator.
|
Instantiator |
makeInstantiator(DAGNode<Component,Dependency> node)
Get a provider that, when invoked, will return an instance of the component represented
by a graph.
|
Instantiator |
makeInstantiator(DAGNode<Component,Dependency> node,
com.google.common.collect.SetMultimap<DAGNode<Component,Dependency>,DAGEdge<Component,Dependency>> backEdges)
Get a provider that, when invoked, will return an instance of the component represented
by a graph with back edges.
|
public static InjectionContainer create()
MEMOIZE
.public static InjectionContainer create(CachePolicy dft)
dft
- The default cache policy.public Instantiator makeInstantiator(DAGNode<Component,Dependency> node)
node
- The graph.graph
.makeInstantiator(DAGNode, SetMultimap)
public Instantiator makeInstantiator(DAGNode<Component,Dependency> node, com.google.common.collect.SetMultimap<DAGNode<Component,Dependency>,DAGEdge<Component,Dependency>> backEdges)
node
- The graph.backEdges
- A multimap of back edges for cyclic dependencies.graph
.Copyright © 2014 GroupLens Research. All Rights Reserved.