1 package org.apachi.onami.lifecycle.warmup;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import javax.inject.Inject;
23 import javax.inject.Singleton;
24 import org.apache.onami.lifecycle.warmup.WarmUp;
25
26 public class Dag3
27 {
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 @SuppressWarnings( "UnusedParameters" )
45 @Singleton
46 public static class A
47 {
48 private final Recorder recorder;
49
50 @Inject
51 public A( Recorder recorder, BnW bnw, B b, D d )
52 {
53 this.recorder = recorder;
54 }
55
56 @WarmUp
57 public void warmUp()
58 throws InterruptedException
59 {
60 recorder.record( "A" );
61 }
62 }
63
64 @SuppressWarnings( "UnusedParameters" )
65 @Singleton
66 public static class B
67 {
68 private final Recorder recorder;
69
70 @Inject
71 public B( Recorder recorder, CnW cnw )
72 {
73 this.recorder = recorder;
74 }
75
76 @WarmUp
77 public void warmUp()
78 throws InterruptedException
79 {
80 recorder.record( "B" );
81 }
82 }
83
84 @SuppressWarnings( "UnusedParameters" )
85 @Singleton
86 public static class BnW
87 {
88 @Inject
89 public BnW( C c )
90 {
91 }
92 }
93
94 @SuppressWarnings( "UnusedParameters" )
95 @Singleton
96 public static class C
97 {
98 private final Recorder recorder;
99
100 @Inject
101 public C( Recorder recorder, D d )
102 {
103 this.recorder = recorder;
104 }
105
106 @WarmUp
107 public void warmUp()
108 throws InterruptedException
109 {
110 recorder.record( "C" );
111 }
112 }
113
114 @SuppressWarnings( "UnusedParameters" )
115 @Singleton
116 public static class CnW
117 {
118 @Inject
119 public CnW( D d )
120 {
121 }
122 }
123
124 @Singleton
125 public static class D
126 {
127 private final Recorder recorder;
128
129 @Inject
130 public D( Recorder recorder )
131 {
132 this.recorder = recorder;
133 }
134
135 @WarmUp
136 public void warmUp()
137 throws InterruptedException
138 {
139 recorder.record( "D" );
140 }
141 }
142 }