MentaContainer

Compare Revisions

Ignore whitespace Rev 44 → Rev 43

/trunk/src/main/java/org/mentacontainer/impl/MentaContainer.java
110,10 → 110,9
 
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;
}
130,6 → 129,8
 
public Dependency autowire(Dependency d) {
 
if (dependencies.contains(d)) throw new RuntimeException("Dependency is already set: " + d.getTarget());
 
dependencies.add(d);
 
return d;