(no commit message)
[utils] / support / cdi / src / main / java / org / wamblee / cdi / SimpleInjector.java
index 12ebc30729b5104624963c4775f61e28aafb0500..fff8f113be13fe8525e6b850366f7fac05b42589 100644 (file)
@@ -19,6 +19,26 @@ package org.wamblee.cdi;
  * Singleton injector access. This should be used as main entry point for
  * injection. A different {@link InjectorFactory} can be plugged in for testing.
  * 
+ * Given the following class: 
+ * <pre> 
+ * class Pojo {
+ *   &#064;EJB
+ *   private Service service; 
+ *   
+ *   ...
+ * }
+ * </pre>
+ * injecting the EJB into a POJO is accomplished as follows: 
+ * <pre>
+ *   Pojo pojo = new Pojo(); 
+ *   SimpleInjector injector = new SimpleInjector(); 
+ *   injector.inject(pojo);
+ * </pre>
+ * 
+ * Note that it is recommended to cache the injector because the injector does caching 
+ * of the types that it injects into. Caching the injector makes sure that a class is not
+ * analysed again for annotation every time injection is used. 
+ * 
  * @author Erik Brakkee
  */
 public class SimpleInjector {