MentaContainer

Compare Revisions

Ignore whitespace Rev 38 → Rev 39

/trunk/src/main/java/org/mentacontainer/impl/MentaContainer.java
108,10 → 108,8
}
}
 
public Component ioc(Component component) {
public Component ioc(String key, Component component) {
String key = component.getName();
 
if (beans.containsKey(key)) throw new RuntimeException("Container already set for the bean key: " + key);
 
beans.put(key, component);
121,12 → 119,12
public Component ioc(String key, Class<? extends Object> klass) {
return ioc(new MentaComponent(key, klass));
return ioc(key, new MentaComponent(klass));
}
public Component ioc(String key, Class<? extends Object> klass, boolean singleton) {
return ioc(new MentaComponent(key, klass, singleton));
return ioc(key, new MentaComponent(klass, singleton));
}
 
public Dependency autowire(Dependency d) {