3 import dst.ass2.di.impl.InjectionControllerImpl;
6 * Creates and provides {@link IInjectionController} instances.
8 public class InjectionControllerFactory {
9 private static IInjectionController standalone = null;
10 private static IInjectionController transparent = null;
13 * Returns the singleton {@link IInjectionController} instance.<br/>
14 * If none is available, a new one is created.
16 * @return the instance
18 public static synchronized IInjectionController getStandAloneInstance() {
19 if (standalone == null) {
20 standalone = getNewStandaloneInstance();
26 * Returns the singleton {@link IInjectionController} instance for processing objects modified by an
27 * {@link dst.ass2.di.agent.InjectorAgent InjectorAgent}.<br/>
28 * If none is available, a new one is created.
30 * @return the instance
32 public static synchronized IInjectionController getTransparentInstance() {
33 if (transparent == null) {
34 transparent = getNewTransparentInstance();
40 * Creates and returns a new {@link IInjectionController} instance.
42 * @return the newly created instance
44 public static IInjectionController getNewStandaloneInstance() {
45 return new InjectionControllerImpl(false);
49 * Creates and returns a new {@link IInjectionController} instance for processing objects modified by an
50 * {@link dst.ass2.di.agent.InjectorAgent InjectorAgent}.<br/>
52 * @return the instance
54 public static IInjectionController getNewTransparentInstance() {
55 return new InjectionControllerImpl(true);