* for standard Java EE injection into components. Or, other injection
* frameworks can be used.
* </p>
- *
+ * <p/>
* <p>
* To use this injector override {@link WebApplication#init()} and add the
* listener:
* </p>
- *
+ * <p/>
* <pre>
* @Override
* protected void init() {
* addComponentInstantiationListener(new ComponentInstantiationInjector());
* }
* </pre>
- *
+ *
* @author Erik Brakkee
*/
-public class ComponentInstantiationInjector implements
- IComponentInstantiationListener {
+public class ComponentInstantiationInjector implements IComponentInstantiationListener {
private SimpleInjector injector;
@Override
public void onInstantiation(Component aComponent) {
injector.inject(aComponent);
- aComponent.add(new InjectionBehavior());
+ aComponent.add(new InjectionBehavior(aComponent));
}
-
}