36
36
import ch .qos .logback .classic .joran .JoranConfigurator ;
37
37
import ch .qos .logback .core .Context ;
38
38
import ch .qos .logback .core .CoreConstants ;
39
- import ch .qos .logback .core .joran .spi .DefaultNestedComponentRegistry ;
40
39
import ch .qos .logback .core .joran .spi .ElementSelector ;
41
40
import ch .qos .logback .core .joran .spi .RuleStore ;
42
41
import ch .qos .logback .core .joran .util .beans .BeanDescription ;
43
- import ch .qos .logback .core .joran .util .beans .BeanDescriptionCache ;
44
42
import ch .qos .logback .core .model .ComponentModel ;
45
43
import ch .qos .logback .core .model .Model ;
46
44
import ch .qos .logback .core .model .ModelUtil ;
47
45
import ch .qos .logback .core .model .processor .DefaultProcessor ;
46
+ import ch .qos .logback .core .model .processor .ModelInterpretationContext ;
48
47
import ch .qos .logback .core .spi .ContextAware ;
49
48
import ch .qos .logback .core .spi .ContextAwareBase ;
50
49
@@ -113,9 +112,7 @@ public void processModel(Model model) {
113
112
super .processModel (model );
114
113
if (!NativeDetector .inNativeImage () && isAotProcessingInProgress ()) {
115
114
getContext ().putObject (BeanFactoryInitializationAotContribution .class .getName (),
116
- new LogbackConfigurationAotContribution (model ,
117
- getModelInterpretationContext ().getBeanDescriptionCache (),
118
- getModelInterpretationContext ().getDefaultNestedComponentRegistry (), getContext ()));
115
+ new LogbackConfigurationAotContribution (model , getModelInterpretationContext (), getContext ()));
119
116
}
120
117
}
121
118
@@ -129,9 +126,9 @@ static final class LogbackConfigurationAotContribution implements BeanFactoryIni
129
126
130
127
private final PatternRules patternRules ;
131
128
132
- private LogbackConfigurationAotContribution (Model model , BeanDescriptionCache beanDescriptionCache ,
133
- DefaultNestedComponentRegistry nestedComponentRegistry , Context context ) {
134
- this .modelWriter = new ModelWriter (model , beanDescriptionCache , nestedComponentRegistry );
129
+ private LogbackConfigurationAotContribution (Model model , ModelInterpretationContext interpretationContext ,
130
+ Context context ) {
131
+ this .modelWriter = new ModelWriter (model , interpretationContext );
135
132
this .patternRules = new PatternRules (context );
136
133
}
137
134
@@ -150,15 +147,11 @@ private static final class ModelWriter {
150
147
151
148
private final Model model ;
152
149
153
- private final BeanDescriptionCache beanDescriptionCache ;
150
+ private final ModelInterpretationContext modelInterpretationContext ;
154
151
155
- private final DefaultNestedComponentRegistry nestedComponentRegistry ;
156
-
157
- private ModelWriter (Model model , BeanDescriptionCache beanDescriptionCache ,
158
- DefaultNestedComponentRegistry nestedComponentRegistry ) {
152
+ private ModelWriter (Model model , ModelInterpretationContext modelInterpretationContext ) {
159
153
this .model = model ;
160
- this .beanDescriptionCache = beanDescriptionCache ;
161
- this .nestedComponentRegistry = nestedComponentRegistry ;
154
+ this .modelInterpretationContext = modelInterpretationContext ;
162
155
}
163
156
164
157
private void writeTo (GenerationContext generationContext ) {
@@ -215,7 +208,8 @@ private Set<String> reflectionTypes(Model model) {
215
208
}
216
209
String tag = model .getTag ();
217
210
if (tag != null ) {
218
- String componentType = this .nestedComponentRegistry .findDefaultComponentTypeByTag (tag );
211
+ String componentType = this .modelInterpretationContext .getDefaultNestedComponentRegistry ()
212
+ .findDefaultComponentTypeByTag (tag );
219
213
processComponent (componentType , reflectionTypes );
220
214
}
221
215
for (Model submodel : model .getSubModels ()) {
@@ -226,7 +220,8 @@ private Set<String> reflectionTypes(Model model) {
226
220
227
221
private void processComponent (String componentTypeName , Set <String > reflectionTypes ) {
228
222
if (componentTypeName != null ) {
229
- BeanDescription beanDescription = this .beanDescriptionCache
223
+ componentTypeName = this .modelInterpretationContext .getImport (componentTypeName );
224
+ BeanDescription beanDescription = this .modelInterpretationContext .getBeanDescriptionCache ()
230
225
.getBeanDescription (loadComponentType (componentTypeName ));
231
226
reflectionTypes .addAll (parameterTypesNames (beanDescription .getPropertyNameToAdder ().values ()));
232
227
reflectionTypes .addAll (parameterTypesNames (beanDescription .getPropertyNameToSetter ().values ()));
0 commit comments