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