|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2020 the original author or authors. |
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -65,7 +65,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex |
|
|
|
* through {@link #register} calls and then manually {@linkplain #refresh refreshed}. |
|
|
|
* through {@link #register} calls and then manually {@linkplain #refresh refreshed}. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public AnnotationConfigApplicationContext() { |
|
|
|
public AnnotationConfigApplicationContext() { |
|
|
|
StartupStep createAnnotatedBeanDefReader = this.getApplicationStartup().start("spring.context.annotated-bean-reader.create"); |
|
|
|
StartupStep createAnnotatedBeanDefReader = getApplicationStartup().start("spring.context.annotated-bean-reader.create"); |
|
|
|
this.reader = new AnnotatedBeanDefinitionReader(this); |
|
|
|
this.reader = new AnnotatedBeanDefinitionReader(this); |
|
|
|
createAnnotatedBeanDefReader.end(); |
|
|
|
createAnnotatedBeanDefReader.end(); |
|
|
|
this.scanner = new ClassPathBeanDefinitionScanner(this); |
|
|
|
this.scanner = new ClassPathBeanDefinitionScanner(this); |
|
|
|
@ -163,7 +163,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void register(Class<?>... componentClasses) { |
|
|
|
public void register(Class<?>... componentClasses) { |
|
|
|
Assert.notEmpty(componentClasses, "At least one component class must be specified"); |
|
|
|
Assert.notEmpty(componentClasses, "At least one component class must be specified"); |
|
|
|
StartupStep registerComponentClass = this.getApplicationStartup().start("spring.context.component-classes.register") |
|
|
|
StartupStep registerComponentClass = getApplicationStartup().start("spring.context.component-classes.register") |
|
|
|
.tag("classes", () -> Arrays.toString(componentClasses)); |
|
|
|
.tag("classes", () -> Arrays.toString(componentClasses)); |
|
|
|
this.reader.register(componentClasses); |
|
|
|
this.reader.register(componentClasses); |
|
|
|
registerComponentClass.end(); |
|
|
|
registerComponentClass.end(); |
|
|
|
@ -180,7 +180,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void scan(String... basePackages) { |
|
|
|
public void scan(String... basePackages) { |
|
|
|
Assert.notEmpty(basePackages, "At least one base package must be specified"); |
|
|
|
Assert.notEmpty(basePackages, "At least one base package must be specified"); |
|
|
|
StartupStep scanPackages = this.getApplicationStartup().start("spring.context.base-packages.scan") |
|
|
|
StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan") |
|
|
|
.tag("packages", () -> Arrays.toString(basePackages)); |
|
|
|
.tag("packages", () -> Arrays.toString(basePackages)); |
|
|
|
this.scanner.scan(basePackages); |
|
|
|
this.scanner.scan(basePackages); |
|
|
|
scanPackages.end(); |
|
|
|
scanPackages.end(); |
|
|
|
|