4 * The dependency injection controller interface.
6 public interface IInjectionController {
9 * Injects all fields annotated with {@link dst.ass2.di.annotation.Inject @Inject}.<br/>
10 * Only objects of classes annotated with {@link dst.ass2.di.annotation.Component @Component} shall be accepted.
12 * @param obj the object to initialize.
13 * @throws InjectionException if it's no component or dependency injection fails.
15 void initialize(Object obj) throws InjectionException;
18 * Gets the fully initialized instance of a singleton component.<br/>
19 * Multiple calls of this method always have to return the same instance.
20 * Only classes that are annotated with {@link dst.ass2.di.annotation.Component Component} shall be accepted.
22 * @param <T> the class type.
23 * @param clazz the class of the component.
24 * @return the initialized singleton object.
25 * @throws InjectionException if it's no component or dependency injection fails.
27 <T> T getSingletonInstance(Class<T> clazz) throws InjectionException;