AnnotationConfigWebApplicationContext allows for repeated register/scan calls

Restoring consistency with AnnotationConfigApplicationContext.

Issue: SPR-10852
This commit is contained in:
Juergen Hoeller
2013-08-28 00:04:53 +02:00
parent 091712df06
commit 01b8d9327d
2 changed files with 58 additions and 92 deletions

View File

@@ -120,7 +120,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) {
this.reader.setBeanNameGenerator(beanNameGenerator);
this.scanner.setBeanNameGenerator(beanNameGenerator);
this.getBeanFactory().registerSingleton(
getBeanFactory().registerSingleton(
AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR, beanNameGenerator);
}
@@ -137,9 +137,9 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
/**
* Register one or more annotated classes to be processed.
* Note that {@link #refresh()} must be called in order for the context to fully
* process the new class.
* <p>Calls to {@link #register} are idempotent; adding the same
* Note that {@link #refresh()} must be called in order for the context
* to fully process the new class.
* <p>Calls to {@code register} are idempotent; adding the same
* annotated class more than once has no additional effect.
* @param annotatedClasses one or more annotated classes,
* e.g. {@link Configuration @Configuration} classes