MentaContainer

Compare Revisions

Ignore whitespace Rev 140 → Rev 141

/trunk/src/test/java/org/mentacontainer/impl/GenericFactoryTest.java
3,10 → 3,8
import junit.framework.Assert;
 
import org.junit.Test;
import org.mentacontainer.Factory;
import org.mentacontainer.Container;
import org.mentacontainer.impl.GenericFactory;
import org.mentacontainer.impl.MentaContainer;
import org.mentacontainer.Creator;
 
public class GenericFactoryTest {
27,7 → 25,7
Container c = new MentaContainer();
// giveMeSomething => method that will be called to return object
Factory generic = new GenericFactory(factory, "giveMeSomething");
Creator<String> generic = new GenericFactory<String>(factory, "giveMeSomething");
c.ioc("myFactory", generic);
/trunk/src/test/java/org/mentacontainer/impl/MentaContainerTest.java
3,9 → 3,9
import junit.framework.Assert;
 
import org.junit.Test;
import org.mentacontainer.Interceptor;
import org.mentacontainer.Factory;
import org.mentacontainer.Container;
import org.mentacontainer.Creator;
import org.mentacontainer.Interceptor;
import org.mentacontainer.Scope;
 
public class MentaContainerTest {
436,100 → 436,4
Assert.assertNotNull(conn.getMyDep());
}
private static class SomeObject {
private boolean destroyed = false;
private boolean created = false;
public void destroyed() { this.destroyed = true; }
public boolean isDestroyed() { return destroyed; }
public void created() { this.created = true; }
public boolean isCreated() { return created; }
}
private static class SomeFactory implements Factory, Interceptor<SomeObject> {
@Override
public <T> T getInstance() {
return (T) new SomeObject();
}
@Override
public Class<? extends Object> getType() {
return SomeObject.class;
}
@Override
public void onCleared(SomeObject obj) {
obj.destroyed();
}
@Override
public void onCreated(SomeObject obj) {
obj.created();
}
}
@Test
public void testInterceptor() {
Container c = new MentaContainer();
c.ioc("o", new SomeFactory(), Scope.SINGLETON);
SomeObject o = c.get("o");
Assert.assertTrue(o.isCreated());
c.clear(Scope.SINGLETON);
Assert.assertEquals(true, o.isDestroyed());
c.ioc("o", new SomeFactory(), Scope.THREAD);
o = c.get("o");
Assert.assertTrue(o.isCreated());
c.clear(Scope.SINGLETON);
Assert.assertEquals(false, o.isDestroyed());
c.clear(Scope.THREAD);
Assert.assertEquals(true, o.isDestroyed());
c.ioc("o", new SomeFactory(), Scope.NONE);
o = c.get("o");
Assert.assertTrue(o.isCreated());
o = c.clear("o");
Assert.assertNull(o);
c.ioc("o", new SomeFactory(), Scope.THREAD);
o = c.clear("o");
Assert.assertNull(o);
o = c.get("o");
Assert.assertTrue(o.isCreated());
o = c.clear("o");
Assert.assertEquals(true, o.isDestroyed());
}
}
/trunk/src/test/java/org/mentacontainer/impl/WrapperFactoryTest.java
3,8 → 3,8
import junit.framework.Assert;
 
import org.junit.Test;
import org.mentacontainer.Factory;
import org.mentacontainer.Container;
import org.mentacontainer.Creator;
 
public class WrapperFactoryTest {
13,7 → 13,7
String s = new String("saoj");
Factory ic = new WrapperFactory(s);
Creator<String> ic = new WrapperFactory<String>(s);
Container c = new MentaContainer();
/trunk/src/test/java/org/mentacontainer/impl/ClassFactoryTest.java
3,6 → 3,7
import junit.framework.Assert;
 
import org.junit.Test;
import org.mentacontainer.Creator;
import org.mentacontainer.Factory;
 
public class ClassFactoryTest {
31,13 → 32,13
MentaContainer container = new MentaContainer();
Factory c1 = new ClassFactory(container, User.class).addInitValue("saoj");
Creator<User> c1 = new ClassFactory<User>(container, User.class).addInitValue("saoj");
Factory c2 = new ClassFactory(container, User.class).addPropertyValue("username", "soliveira");
Creator<User> c2 = new ClassFactory<User>(container, User.class).addPropertyValue("username", "soliveira");
User u1 = c1.getInstance();
User u1 = c1.createInstance();
User u2 = c2.getInstance();
User u2 = c2.createInstance();
Assert.assertTrue(u1 != u2);
66,10 → 67,10
c.ioc("myString", String.class).addInitValue("hello");
Factory c1 = new ClassFactory(c, TestObj1.class).addConstructorDependency("myString").addInitValue(20).addInitValue(30000L)
Creator<TestObj1> c1 = new ClassFactory<TestObj1>(c, TestObj1.class).addConstructorDependency("myString").addInitValue(20).addInitValue(30000L)
.addInitValue(new User("saoj"));
TestObj1 o = c1.getInstance();
TestObj1 o = c1.createInstance();
Assert.assertEquals("hello", o.s);
Assert.assertEquals(20, o.i);
95,9 → 96,9
c.ioc("myString", String.class).addInitValue("hello");
Factory c1 = new ClassFactory(c, TestObj1_1.class).addPropertyDependency("s", "myString").addPropertyValue("i", 30);
Creator<TestObj1_1> c1 = new ClassFactory<TestObj1_1>(c, TestObj1_1.class).addPropertyDependency("s", "myString").addPropertyValue("i", 30);
TestObj1_1 o = c1.getInstance();
TestObj1_1 o = c1.createInstance();
Assert.assertEquals("hello", o.s);
Assert.assertEquals(30, o.i);
119,9 → 120,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj2.class).addPropertyValue("integer", 20);
Creator<TestObj2> f = new ClassFactory<TestObj2>(container, TestObj2.class).addPropertyValue("integer", 20);
TestObj2 o = f.getInstance();
TestObj2 o = f.createInstance();
Assert.assertEquals(20, o.x);
}
131,9 → 132,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj2.class).addPropertyValue("integer", new Integer(20));
Creator<TestObj2> f = new ClassFactory<TestObj2>(container, TestObj2.class).addPropertyValue("integer", new Integer(20));
TestObj2 o = f.getInstance();
TestObj2 o = f.createInstance();
Assert.assertEquals(20, o.x);
}
154,9 → 155,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj2_1.class).addPropertyValue("integer", 20);
Creator<TestObj2_1> f = new ClassFactory<TestObj2_1>(container, TestObj2_1.class).addPropertyValue("integer", 20);
TestObj2_1 o = f.getInstance();
TestObj2_1 o = f.createInstance();
Assert.assertEquals(20, o.x);
}
166,9 → 167,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj2_1.class).addPropertyValue("integer", new Integer(20));
Creator<TestObj2_1>f = new ClassFactory<TestObj2_1>(container, TestObj2_1.class).addPropertyValue("integer", new Integer(20));
TestObj2_1 o = f.getInstance();
TestObj2_1 o = f.createInstance();
Assert.assertEquals(20, o.x);
}
188,9 → 189,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj3.class).addInitValue(20);
Creator<TestObj3> f = new ClassFactory<TestObj3>(container, TestObj3.class).addInitValue(20);
TestObj3 o = f.getInstance();
TestObj3 o = f.createInstance();
Assert.assertEquals(20, o.x);
}
209,9 → 210,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj3_1.class).addInitValue(20);
Creator<TestObj3_1> f = new ClassFactory<TestObj3_1>(container, TestObj3_1.class).addInitValue(20);
TestObj3_1 o = f.getInstance();
TestObj3_1 o = f.createInstance();
Assert.assertEquals(20, o.x);
}
232,9 → 233,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj3_2.class).addInitValue(20).addInitPrimitive(30L);
Creator<TestObj3_2> f = new ClassFactory<TestObj3_2>(container, TestObj3_2.class).addInitValue(20).addInitPrimitive(30L);
TestObj3_2 o = f.getInstance();
TestObj3_2 o = f.createInstance();
Assert.assertEquals(20, o.x);
Assert.assertEquals(30L, o.l);
260,9 → 261,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj4.class).addInitPrimitive(20).addInitValue("hello").addInitValue(20L).addInitPrimitive(20L);
Creator<TestObj4> f = new ClassFactory<TestObj4>(container, TestObj4.class).addInitPrimitive(20).addInitValue("hello").addInitValue(20L).addInitPrimitive(20L);
TestObj4 o = f.getInstance();
TestObj4 o = f.createInstance();
Assert.assertEquals(20, o.x);
Assert.assertEquals("hello", o.s);
280,9 → 281,9
MentaContainer container = new MentaContainer();
Factory f = new ClassFactory(container, TestObj22.class);
Creator<TestObj22> f = new ClassFactory<TestObj22>(container, TestObj22.class);
TestObj22 o = f.getInstance();
TestObj22 o = f.createInstance();
Assert.assertNotNull(o);
/trunk/src/main/java/org/mentacontainer/Creator.java
New file
0,0 → 1,9
package org.mentacontainer;
 
public interface Creator<E> {
public E createInstance();
public Class<E> getType();
}
/trunk/src/main/java/org/mentacontainer/impl/GenericFactory.java
2,17 → 2,17
 
import java.lang.reflect.Method;
 
import org.mentacontainer.Factory;
import org.mentacontainer.Creator;
import org.mentacontainer.Interceptor;
import org.mentacontainer.util.FindMethod;
 
public class GenericFactory<E> implements Factory, Interceptor<E> {
public class GenericFactory<E> implements Creator<E>, Interceptor<E> {
private final Object factory;
private final Method method;
private final Class<? extends Object> type;
private final Class<E> type;
private Interceptor<E> interceptor = null;
26,7 → 26,7
this.method.setAccessible(true);
this.type = method.getReturnType();
this.type = (Class<E>) method.getReturnType();
} catch(Exception e) {
54,11 → 54,11
}
@Override
public <T> T getInstance() {
public E createInstance() {
try {
return (T) method.invoke(factory, (Object[]) null);
return (E) method.invoke(factory, (Object[]) null);
} catch(Exception e) {
68,7 → 68,7
}
@Override
public Class<? extends Object> getType() {
public Class<E> getType() {
return type;
}
}
/trunk/src/main/java/org/mentacontainer/impl/MentaContainer.java
11,8 → 11,9
 
import org.mentacontainer.ConfigurableFactory;
import org.mentacontainer.Container;
import org.mentacontainer.Factory;
import org.mentacontainer.Creator;
import org.mentacontainer.Interceptor;
import org.mentacontainer.Pool;
import org.mentacontainer.Scope;
import org.mentacontainer.util.InjectionUtils;
import org.mentacontainer.util.InjectionUtils.Provider;
24,7 → 25,7
*/
public class MentaContainer implements Container {
 
private Map<String, Factory> factoriesByName = new Hashtable<String, Factory>();
private Map<String, Pool<?>> factoriesByName = new Hashtable<String, Pool<?>>();
private Map<String, Scope> scopes = new Hashtable<String, Scope>();
43,7 → 44,7
String k = InjectionUtils.getKeyName(key);
Factory factory = factoriesByName.get(k);
Creator<?> factory = factoriesByName.get(k);
if (factory == null) return null;
61,16 → 62,11
for(String key : singletonsCache.keySet()) {
Factory factory = factoriesByName.get(key);
Pool<?> pool = factoriesByName.get(key);
if (factory instanceof Interceptor) {
Interceptor c = (Interceptor) factory;
Object value = singletonsCache.get(key);
Object value = singletonsCache.get(key);
listToClear.add(new ClearableHolder(c, value));
}
listToClear.add(new ClearableHolder(pool, value));
}
singletonsCache.clear();
88,18 → 84,13
for(String key : threadLocalsCache.keySet()) {
Factory factory = factoriesByName.get(key);
Pool<?> factory = factoriesByName.get(key);
if (factory instanceof Interceptor) {
Interceptor c = (Interceptor) factory;
ThreadLocal<Object> t = threadLocalsCache.get(key);
Object value = t.get();
if (value != null) listToClear.add(new ClearableHolder(c, value));
}
ThreadLocal<Object> t = threadLocalsCache.get(key);
Object value = t.get();
if (value != null) listToClear.add(new ClearableHolder(factory, value));
}
for(ThreadLocal<Object> t : threadLocalsCache.values()) {
135,18 → 126,13
if (value != null) {
Factory factory = factoriesByName.get(keyString);
Pool<?> factory = factoriesByName.get(keyString);
if (factory instanceof Interceptor) {
Interceptor c = (Interceptor) factory;
cp = new ClearableHolder(c, value);
}
cp = new ClearableHolder(factory, value);
}
}
if (cp != null) cp.c.onCleared(cp.value);
if (cp != null) cp.clear();
return (T) value;
166,14 → 152,9
if (o != null) {
Factory factory = factoriesByName.get(keyString);
Pool<?> factory = factoriesByName.get(keyString);
if (factory instanceof Interceptor) {
Interceptor c = (Interceptor) factory;
cp = new ClearableHolder(c, o);
}
cp = new ClearableHolder(factory, o);
t.remove();
182,7 → 163,7
}
}
if (cp != null) cp.c.onCleared(cp.value);
if (cp != null) cp.clear();
return (T) retVal;
203,7 → 184,7
 
if (!factoriesByName.containsKey(keyString)) return null;
 
Factory c = factoriesByName.get(keyString);
Creator<?> c = factoriesByName.get(keyString);
Scope scope = scopes.get(keyString);
233,7 → 214,7
// getInstance needs to be in a non-synchronized block
target = c.getInstance();
target = c.createInstance();
checkInterceptable(c, target);
287,7 → 268,7
// getInstance needs to be in a non-synchronized block
target = c.getInstance();
target = c.createInstance();
checkInterceptable(c, target);
304,7 → 285,7
} else if (scope == Scope.NONE) {
 
target = c.getInstance();
target = c.createInstance();
checkInterceptable(c, target);
357,7 → 338,7
}
}
private final void checkInterceptable(Factory f, Object value) {
private final void checkInterceptable(Creator<?> f, Object value) {
if (f instanceof Interceptor) {
367,12 → 348,33
}
}
private static <T> Pool<T> fromFactory(final Creator<T> creator) {
return new Pool<T>() {
 
@Override
public T createInstance() {
return creator.createInstance();
}
 
@Override
public Class<T> getType() {
return creator.getType();
}
 
@Override
public void releaseInstance(T e) {
// do nothing!
}
};
}
@Override
public Factory ioc(Object key, Factory factory, Scope scope) {
public <T> Creator<T> ioc(Object key, Creator<T> factory, Scope scope) {
String keyString = InjectionUtils.getKeyName(key);
factoriesByName.put(keyString, factory);
factoriesByName.put(keyString, fromFactory(factory));
singletonsCache.remove(keyString); // just in case we are overriding a previous singleton bean...
389,15 → 391,15
}
@Override
public Factory ioc(Object key, Factory factory) {
public Creator<?> ioc(Object key, Creator<?> factory) {
return ioc(key, factory, Scope.NONE);
}
@Override
public ConfigurableFactory ioc(Object key, Class<? extends Object> klass) {
public <T> ConfigurableFactory<T> ioc(Object key, Class<T> klass) {
ConfigurableFactory cc = new ClassFactory(this, klass);
ConfigurableFactory<T> cc = new ClassFactory<T>(this, klass);
ioc(key, cc);
405,9 → 407,9
}
@Override
public ConfigurableFactory ioc(Object key, Class<? extends Object> klass, Scope scope) {
public <T> ConfigurableFactory<T> ioc(Object key, Class<T> klass, Scope scope) {
ConfigurableFactory cc = new ClassFactory(this, klass);
ConfigurableFactory<T> cc = new ClassFactory<T>(this, klass);
ioc(key, cc, scope);
467,11 → 469,11
}
@Override
public <T> T construct(Class<? extends Object> klass) {
public <T> T construct(Class<T> klass) {
ClassFactory f = new ClassFactory(this, klass, forConstructMethod);
ClassFactory<T> f = new ClassFactory<T>(this, klass, forConstructMethod);
return (T) f.getInstance();
return f.createInstance();
}
 
@Override
536,16 → 538,16
private static class ClearableHolder {
 
private Interceptor c;
private Pool<Object> c;
private Object value;
public ClearableHolder(Interceptor c, Object value) {
this.c = c;
public ClearableHolder(Pool<?> c, Object value) {
this.c = (Pool<Object>) c;
this.value = value;
}
public void clear() {
c.onCleared(value);
c.releaseInstance(value);
}
}
/trunk/src/main/java/org/mentacontainer/impl/WrapperFactory.java
1,29 → 1,28
package org.mentacontainer.impl;
 
import org.mentacontainer.Factory;
import org.mentacontainer.Creator;
 
public class WrapperFactory implements Factory {
public class WrapperFactory<E> implements Creator<E> {
private final Object instance;
private final E instance;
private final Class<? extends Object> type;
private final Class<E> type;
public WrapperFactory(Object instance) {
public WrapperFactory(E instance) {
 
this.instance = instance;
this.type = instance.getClass();
this.type = (Class<E>) instance.getClass();
}
@Override
public <T> T getInstance() {
return (T) instance;
public E createInstance() {
return instance;
}
@Override
public Class<? extends Object> getType() {
public Class<E> getType() {
return type;
}
/trunk/src/main/java/org/mentacontainer/impl/ClassFactory.java
20,11 → 20,11
*
* @author sergio.oliveira.jr@gmail.com
*/
class ClassFactory implements ConfigurableFactory {
class ClassFactory<E> implements ConfigurableFactory<E> {
private final MentaContainer container;
private final Class<? extends Object> klass;
private final Class<E> klass;
private Map<String, Object> props = null;
40,12 → 40,12
private final Set<ConstructorDependency> constructorDependencies;
public ClassFactory(MentaContainer container, Class<? extends Object> klass) {
public ClassFactory(MentaContainer container, Class<E> klass) {
 
this(container, klass, null);
}
ClassFactory(MentaContainer container, Class<? extends Object> klass, Set<ConstructorDependency> constructorDependencies) {
ClassFactory(MentaContainer container, Class<E> klass, Set<ConstructorDependency> constructorDependencies) {
this.container = container;
57,7 → 57,7
 
@Override
public ConfigurableFactory addPropertyValue(String name, Object value) {
public ConfigurableFactory<E> addPropertyValue(String name, Object value) {
if (props == null) {
72,7 → 72,7
}
@Override
public ConfigurableFactory useZeroArgumentConstructor() {
public ConfigurableFactory<E> useZeroArgumentConstructor() {
this.useZeroArgumentsConstructor = true;
80,7 → 80,7
}
@Override
public ConfigurableFactory addPropertyDependency(String property, Object key) {
public ConfigurableFactory<E> addPropertyDependency(String property, Object key) {
String k = InjectionUtils.getKeyName(key);
88,20 → 88,20
}
@Override
public ConfigurableFactory addPropertyDependency(String property) {
public ConfigurableFactory<E> addPropertyDependency(String property) {
return addPropertyDependency(property, property);
}
@Override
public ConfigurableFactory addConstructorDependency(Object key) {
public ConfigurableFactory<E> addConstructorDependency(Object key) {
String k = InjectionUtils.getKeyName(key);
return addInitValue(new DependencyKey(k), container.getType(k));
}
private ConfigurableFactory addInitValue(Object value, Class<? extends Object> type) {
private ConfigurableFactory<E> addInitValue(Object value, Class<? extends Object> type) {
if (initValues == null) {
118,13 → 118,13
}
@Override
public ConfigurableFactory addInitValue(Object value) {
public ConfigurableFactory<E> addInitValue(Object value) {
return addInitValue(value, value.getClass());
}
@Override
public ConfigurableFactory addInitPrimitive(Object value) {
public ConfigurableFactory<E> addInitPrimitive(Object value) {
Class<? extends Object> primitive = getPrimitiveFrom(value);
290,7 → 290,7
}
@Override
public <T> T getInstance() {
public E createInstance() {
Object obj = null;
373,7 → 373,7
}
}
return (T) obj;
return (E) obj;
}
private static boolean betterIsAssignableFrom(Class<? extends Object> klass1, Class<? extends Object> klass2) {
499,7 → 499,7
}
@Override
public Class<? extends Object> getType() {
public Class<E> getType() {
return klass;
}
}
/trunk/src/main/java/org/mentacontainer/Container.java
38,7 → 38,7
* @param key The factory
* @return The type returned by this factory
*/
public Class<? extends Object> getType(Object key);
public Class<?> getType(Object key);
/**
* Configure a bean to be returned with the given implementation when {@link #get(String)} is called.
50,7 → 50,7
* @return The factory created as a ConfigurableFactory. (Fluent API)
* @see Scope
*/
public ConfigurableFactory ioc(Object key, Class<? extends Object> klass, Scope scope);
public <T> ConfigurableFactory<T> ioc(Object key, Class<T> klass, Scope scope);
/**
* Same as {@link #ioc(String, Class, Scope)} except that it assumes
61,7 → 61,7
* @return The factory created as a ConfigurableFactory. (Fluent API)
* @see Scope
*/
public ConfigurableFactory ioc(Object key, Class<?extends Object> klass);
public <T> ConfigurableFactory<T> ioc(Object key, Class<T> klass);
/**
* Set up a factory for the given key. The scope assumed is NONE.
71,7 → 71,7
* @return The factory passed as a parameter. (Fluent API)
* @see Factory
*/
public Factory ioc(Object key, Factory factory);
public Creator<?> ioc(Object key, Creator<?> factory);
/**
* Set up a factory for the given key in the given scope.
83,7 → 83,7
* @see Factory
* @see Scope
*/
public Factory ioc(Object key, Factory factory, Scope scope);
public <T> Creator<T> ioc(Object key, Creator<T> factory, Scope scope);
/**
* Configure a bean dependency to be auto-wired by the container.
118,7 → 118,7
* @param klass The class that should be instantiated.
* @return An instantiated bean.
*/
public <T> T construct(Class<? extends Object> klass);
public <T> T construct(Class<T> klass);
/**
* Check whether the container currently has a value for this key. For example,
/trunk/src/main/java/org/mentacontainer/ConfigurableFactory.java
12,7 → 12,7
* @author sergio.oliveira.jr@gmail.com
* @see Interceptor
*/
public interface ConfigurableFactory extends Factory {
public interface ConfigurableFactory<E> extends Creator<E> {
/**
* Add a constructor parameter to be used when the bean is instantiated. It can be called more than once to
21,7 → 21,7
* @param value A parameter value to be used by a constructor.
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory addInitValue(Object value);
public ConfigurableFactory<E> addInitValue(Object value);
/**
* Add a constructor parameter that is a primitive to be used when the bean is instantiated. It can be called more than once to
35,7 → 35,7
* @param value A parameter value to be used by a constructor. Must be a primitive that will be autoboxed.
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory addInitPrimitive(Object value);
public ConfigurableFactory<E> addInitPrimitive(Object value);
/**
45,7 → 45,7
* @param key The key used to get an instance from the container
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory addConstructorDependency(Object key);
public ConfigurableFactory<E> addConstructorDependency(Object key);
/**
* In case you want to force the use of a zero argument constructor and avoid any ambiguity when choosing the constructor to use.
55,7 → 55,7
*
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory useZeroArgumentConstructor();
public ConfigurableFactory<E> useZeroArgumentConstructor();
/**
* Add a property to be injected through a setter when the factory instantiates an object.
64,7 → 64,7
* @param value The property value.
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory addPropertyValue(String name, Object value);
public ConfigurableFactory<E> addPropertyValue(String name, Object value);
/**
* Add a setter property that is a dependency, in other words, its value will be obtained from the container.
74,7 → 74,7
* @param property The dependency name which is equal to the property name.
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory addPropertyDependency(String property);
public ConfigurableFactory<E> addPropertyDependency(String property);
/**
* Add a setter property that is a dependency, in other words, its value will be obtained from the container.
85,5 → 85,5
* @param key The dependency name, in other words, the key used to get a bean from the container.
* @return The factory itself. (Fluent API)
*/
public ConfigurableFactory addPropertyDependency(String property, Object key);
public ConfigurableFactory<E> addPropertyDependency(String property, Object key);
}
/trunk/src/main/java/org/mentacontainer/Pool.java
New file
0,0 → 1,7
package org.mentacontainer;
 
public interface Pool<E> extends Creator<E> {
public void releaseInstance(E e);
}