-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit a7f090a
committed
Make MapJobRegistry smart to auto register jobs at startup
Before this commit, it was required to populate the job registry
with a different component (like a bean post processor or a smart
initializing singleton) before being able to use it with the JobOperator.
This commit makes the `MapJobRegistry` smart enough to auto register
jobs defined in the application context. This removes the need for a
distinct component to populate the registry and therefore simplifies
the configuration.
This commit also:
- removes the usage of `JobFactory` from `JobRegistry`
- deprecates JobRegistrySmartInitializingSingleton and removes
its configuration from the default batch configuration
Resolves #4854
Resolves #4855
Resolves #4856 1 parent 08c4cb1 commit a7f090a
File tree
18 files changed
+87
-234
lines changed- spring-batch-core/src
- main/java/org/springframework/batch/core/configuration
- annotation
- support
- test
- java/org/springframework/batch/core/configuration
- annotation
- support
- xml
- resources/org/springframework/batch/core/configuration
- support
- xml
18 files changed
+87
-234
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 | + | ||
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
31 | - | ||
32 | - | ||
32 | + | ||
33 | + | ||
33 | 34 |
| |
34 | 35 |
| |
35 | - | ||
36 | + | ||
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
|
Lines changed: 0 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 | - | ||
26 | 25 |
| |
27 | 26 |
| |
28 | 27 |
| |
| |||
70 | 69 |
| |
71 | 70 |
| |
72 | 71 |
| |
73 | - | ||
74 | 72 |
| |
75 | 73 |
| |
76 | 74 |
| |
| |||
220 | 218 |
| |
221 | 219 |
| |
222 | 220 |
| |
223 | - | ||
224 | - | ||
225 | - | ||
226 | - | ||
227 | - | ||
228 | - | ||
229 | - | ||
230 | - | ||
231 | - | ||
232 | - | ||
233 | - | ||
234 | - | ||
235 | - | ||
236 | - | ||
237 | - | ||
238 | 221 |
| |
239 | 222 |
| |
240 | 223 |
| |
|
Lines changed: 0 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 | - | ||
54 | - | ||
55 | 53 |
| |
56 | 54 |
| |
57 | 55 |
| |
| |||
117 | 115 |
| |
118 | 116 |
| |
119 | 117 |
| |
120 | - | ||
121 | - | ||
122 | - | ||
123 | - | ||
124 | - | ||
125 | - | ||
126 | - | ||
127 | - | ||
128 | - | ||
129 | - | ||
130 | - | ||
131 | - | ||
132 | - | ||
133 | - | ||
134 | - | ||
135 | 118 |
| |
136 | 119 |
| |
137 | 120 |
| |
|
Lines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 | - | ||
31 | 30 |
| |
32 | 31 |
| |
33 | 32 |
| |
| |||
251 | 250 |
| |
252 | 251 |
| |
253 | 252 |
| |
254 | - | ||
255 | - | ||
253 | + | ||
256 | 254 |
| |
257 | 255 |
| |
258 | 256 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 | + | ||
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
| |||
53 | 54 |
| |
54 | 55 |
| |
55 | 56 |
| |
56 | - | ||
57 | + | ||
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 | + | ||
49 | + | ||
48 | 50 |
| |
51 | + | ||
49 | 52 |
| |
50 | 53 |
| |
51 | 54 |
| |
| |||
143 | 146 |
| |
144 | 147 |
| |
145 | 148 |
| |
146 | - | ||
147 | - | ||
149 | + | ||
148 | 150 |
| |
149 | 151 |
| |
150 | 152 |
| |
151 | - | ||
153 | + | ||
152 | 154 |
| |
153 | 155 |
| |
154 | 156 |
| |
|
Lines changed: 43 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 | + | ||
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
24 | + | ||
25 | + | ||
23 | 26 |
| |
24 | 27 |
| |
25 | - | ||
26 | 28 |
| |
27 | 29 |
| |
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
28 | 34 |
| |
29 | 35 |
| |
30 | 36 |
| |
31 | 37 |
| |
32 | - | ||
38 | + | ||
39 | + | ||
40 | + | ||
33 | 41 |
| |
34 | 42 |
| |
35 | 43 |
| |
36 | 44 |
| |
37 | 45 |
| |
38 | - | ||
46 | + | ||
47 | + | ||
48 | + | ||
39 | 49 |
| |
40 | 50 |
| |
41 | - | ||
51 | + | ||
42 | 52 |
| |
43 | - | ||
44 | - | ||
45 | - | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
46 | 67 |
| |
47 | 68 |
| |
48 | - | ||
49 | - | ||
50 | - | ||
51 | - | ||
52 | - | ||
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | ||
73 | + | ||
53 | 74 |
| |
54 | - | ||
75 | + | ||
55 | 76 |
| |
56 | 77 |
| |
57 | 78 |
| |
58 | 79 |
| |
59 | 80 |
| |
60 | - | ||
61 | - | ||
81 | + | ||
82 | + | ||
62 | 83 |
| |
63 | 84 |
| |
64 | 85 |
| |
65 | 86 |
| |
66 | - | ||
67 | - | ||
68 | - | ||
87 | + | ||
88 | + | ||
89 | + | ||
69 | 90 |
| |
70 | 91 |
| |
71 | - | ||
92 | + | ||
72 | 93 |
| |
73 | 94 |
| |
74 | 95 |
| |
75 | 96 |
| |
76 | - | ||
97 | + | ||
77 | 98 |
| |
78 | 99 |
| |
79 | 100 |
| |
80 | - | ||
101 | + | ||
81 | 102 |
| |
82 | 103 |
| |
83 | 104 |
|
Lines changed: 0 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 | - | ||
31 | 30 |
| |
32 | 31 |
| |
33 | 32 |
| |
| |||
64 | 63 |
| |
65 | 64 |
| |
66 | 65 |
| |
67 | - | ||
68 | - | ||
69 | 66 |
| |
70 | 67 |
| |
71 | 68 |
| |
| |||
147 | 144 |
| |
148 | 145 |
| |
149 | 146 |
| |
150 | - | ||
151 | - | ||
152 | 147 |
| |
153 | 148 |
| |
154 | 149 |
| |
155 | 150 |
| |
156 | 151 |
| |
157 | 152 |
| |
158 | - | ||
159 | 153 |
| |
160 | 154 |
| |
161 | 155 |
| |
| |||
236 | 230 |
| |
237 | 231 |
| |
238 | 232 |
| |
239 | - | ||
240 | - | ||
241 | - | ||
242 | - | ||
243 | - | ||
244 | 233 |
| |
245 | 234 |
| |
246 | 235 |
| |
|
Lines changed: 1 addition & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 | - | ||
40 | 39 |
| |
41 | 40 |
| |
42 | 41 |
| |
| |||
72 | 71 |
| |
73 | 72 |
| |
74 | 73 |
| |
75 | - | ||
76 | - | ||
77 | - | ||
78 | 74 |
| |
79 | 75 |
| |
80 | 76 |
| |
| |||
87 | 83 |
| |
88 | 84 |
| |
89 | 85 |
| |
90 | - | ||
91 | - | ||
92 | 86 |
| |
93 | 87 |
| |
94 | 88 |
| |
95 | 89 |
| |
96 | 90 |
| |
97 | 91 |
| |
98 | - | ||
99 | 92 |
| |
100 | 93 |
| |
101 | 94 |
| |
| |||
136 | 129 |
| |
137 | 130 |
| |
138 | 131 |
| |
139 | - | ||
140 | - | ||
141 | - | ||
142 | - | ||
143 | - | ||
144 | - | ||
145 | - | ||
146 | 132 |
| |
147 | 133 |
| |
148 | 134 |
|
0 commit comments