(no commit message)
[utils] / support / cdi / src / main / java / org / wamblee / cdi / SimpleInjector.java
index 7a8db0da4397c21531acfcf3e5d75522248d6431..12ebc30729b5104624963c4775f61e28aafb0500 100644 (file)
@@ -23,26 +23,31 @@ package org.wamblee.cdi;
  */
 public class SimpleInjector {
 
-    private static InjectorCache cache = new InjectorCache(
+    private InjectorCache cache = new InjectorCache(
         new CdiInjectorFactory());
 
     /**
-     * Override the injector factory (mainly fo runit test).
-     * 
-     * @param aFactory
-     *            Factory.
+     * Constructs the injector. 
      */
-    public static void setInjectorFactory(InjectorFactory aFactory) {
+    public SimpleInjector() { 
+        cache = new InjectorCache(new CdiInjectorFactory());
+    }
+    
+    /**
+     * Construcst the injector. 
+     * @param aFactory Factory to use. 
+     */
+    public SimpleInjector(InjectorFactory aFactory) { 
         cache = new InjectorCache(aFactory);
     }
-
+    
     /**
      * Injects into a given object.
      * 
      * @param aObject
      *            Object to inject into.
      */
-    public static void inject(Object aObject) {
+    public void inject(Object aObject) {
         cache.getInjector(aObject.getClass()).inject(aObject);
     }
 }