MentaContainer

Compare Revisions

Ignore whitespace Rev 43 → Rev 44

/trunk/src/main/java/org/mentacontainer/impl/MentaContainer.java
110,9 → 110,10
 
public Component ioc(String key, Component component) {
if (beans.containsKey(key)) throw new RuntimeException("Container already set for the bean key: " + key);
 
beans.put(key, component);
// clear the singleton cache in case of adding again...
singletons.remove(key);
 
return component;
}
129,8 → 130,6
 
public Dependency autowire(Dependency d) {
 
if (dependencies.contains(d)) throw new RuntimeException("Dependency is already set: " + d.getTarget());
 
dependencies.add(d);
 
return d;