MentaContainer

Compare Revisions

Ignore whitespace Rev 50 → Rev 51

/trunk/src/main/java/org/mentacontainer/impl/MentaComponent.java
28,24 → 28,11
private Map<String, Method> cache = null;
private final boolean singleton;
private Object singletonValue = null;
 
public MentaComponent(Class<? extends Object> klass, boolean singleton) {
public MentaComponent(Class<? extends Object> klass) {
this.klass = klass;
this.singleton = singleton;
}
public MentaComponent(Class<? extends Object> klass) {
this(klass, false);
}
public boolean isSingleton() { return singleton; }
public ConfigurableComponent addProperty(String name, Object value) {
if (props == null) {
196,8 → 183,6
public <T> T getInstance() {
if (singleton && singletonValue != null) return (T) singletonValue;
Object obj = null;
if (initValues != null && initValues.size() > 0) {
249,8 → 234,6
}
}
if (obj != null && singleton) singletonValue = obj;
return (T) obj;
}
}