1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package tools.gsf.config.inject;
17
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
20
21 import COM.FutureTense.Interfaces.ICS;
22 import tools.gsf.time.Stopwatch;
23
24
25
26
27
28 public class AnnotationInjector implements Injector {
29
30 private static final Logger LOG = LoggerFactory.getLogger(AnnotationInjector.class);
31
32 private final Stopwatch stopwatch;
33 private final Injector[] injectors;
34
35 public AnnotationInjector(Stopwatch stopwatch, Injector... injectors) {
36 this.stopwatch = stopwatch;
37 this.injectors = injectors;
38 }
39
40 @Override
41 public void inject(Object dependent) {
42 stopwatch.start();
43 for (Injector injector : injectors) {
44 if (LOG.isDebugEnabled()) {
45 LOG.debug("AnnotationInjector will now attempt injection into " + dependent + " using injector " + injector.getClass().getSimpleName());
46 }
47 injector.inject(dependent);
48 stopwatch.split("AnnotationInjector: {} injection done", injector.getClass().getSimpleName());
49 }
50 stopwatch.elapsed("AnnotationInjector: injection complete");
51 }
52 }