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 without a lifecycle manager.
|
static InjectionContainer |
create(CachePolicy dft,
LifecycleManager mgr)
Create a new instantiator.
|
LifecycleManager |
getLifecycleManager()
Get the lifecycle manager for this container.
|
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 static InjectionContainer create(CachePolicy dft, LifecycleManager mgr)
dft
- The default cache policy.mgr
- The lifecycle manager.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
.@Nullable public LifecycleManager getLifecycleManager()
Copyright © 2016 GroupLens Research. All rights reserved.