/trunk/src/main/java/org/mentacontainer/impl/MentaComponent.java |
---|
32,6 → 32,8 |
private final boolean singleton; |
private Object singletonValue = null; |
public MentaComponent(String name, Class<? extends Object> klass, boolean singleton) { |
this.name = name; |
220,6 → 222,8 |
public Object getInstance() throws InstantiationException { |
if (singleton && singletonValue != null) return singletonValue; |
Object obj = null; |
if (initValues != null && initValues.size() > 0) { |
271,6 → 275,8 |
} |
} |
if (obj != null && singleton) singletonValue = obj; |
return obj; |
} |
} |