@@ -545,21 +545,21 @@ XML-based configuration metadata, you can use the `<alias/>` element to accompli
545
545
<alias name="fromName" alias="toName"/>
546
546
----
547
547
548
- In this case, a bean in the same container which is named `fromName`, may also,
548
+ In this case, a bean ( in the same container) named `fromName` may also,
549
549
after the use of this alias definition, be referred to as `toName`.
550
550
551
- For example, the configuration metadata for subsystem A may refer to a DataSource via
552
- the name `subsystemA-dataSource`. The configuration metadata for subsystem B may refer to
553
- a DataSource via the name `subsystemB-dataSource`. When composing the main application
554
- that uses both these subsystems the main application refers to the DataSource via the
555
- name `myApp-dataSource`. To have all three names refer to the same object you add to the
556
- MyApp configuration metadata the following aliases definitions:
551
+ For example, the configuration metadata for subsystem A may refer to a DataSource by the
552
+ name of `subsystemA-dataSource`. The configuration metadata for subsystem B may refer to
553
+ a DataSource by the name of `subsystemB-dataSource`. When composing the main application
554
+ that uses both these subsystems, the main application refers to the DataSource by the
555
+ name of `myApp-dataSource`. To have all three names refer to the same object, you can
556
+ add the following alias definitions to the configuration metadata :
557
557
558
558
[source,xml,indent=0]
559
559
[subs="verbatim,quotes"]
560
560
----
561
- <alias name="subsystemA -dataSource" alias="subsystemB -dataSource"/>
562
- <alias name="subsystemA -dataSource" alias="myApp -dataSource" />
561
+ <alias name="myApp -dataSource" alias="subsystemA -dataSource"/>
562
+ <alias name="myApp -dataSource" alias="subsystemB -dataSource"/>
563
563
----
564
564
565
565
Now each component and the main application can refer to the dataSource through a name
@@ -6762,7 +6762,7 @@ annotation accepts a String array for this purpose.
6762
6762
@Configuration
6763
6763
public class AppConfig {
6764
6764
6765
- @Bean(name = { "dataSource", "subsystemA-dataSource", "subsystemB-dataSource" })
6765
+ @Bean({ "dataSource", "subsystemA-dataSource", "subsystemB-dataSource"})
6766
6766
public DataSource dataSource() {
6767
6767
// instantiate, configure and return DataSource bean...
6768
6768
}
0 commit comments