Skip to content

Commit 80b8382

Browse files
committed
Revised alias definition example in reference documentation
Issue: SPR-17536
1 parent ebbe14c commit 80b8382

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/docs/asciidoc/core/core-beans.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,9 @@ itself.
565565
Specifying all aliases where the bean is actually defined is not always adequate,
566566
however. It is sometimes desirable to introduce an alias for a bean that is defined
567567
elsewhere. This is commonly the case in large systems where configuration is split
568-
amongst each subsystem, with each subsystem having its own set of object definitions. In
569-
XML-based configuration metadata, you can use the `<alias/>` element to accomplish this.
570-
The following example shows how to do so:
568+
amongst each subsystem, with each subsystem having its own set of object definitions.
569+
In XML-based configuration metadata, you can use the `<alias/>` element to accomplish
570+
this. The following example shows how to do so:
571571

572572
====
573573
[source,xml,indent=0]
@@ -580,19 +580,19 @@ The following example shows how to do so:
580580
In this case, a bean (in the same container) named `fromName` may also,
581581
after the use of this alias definition, be referred to as `toName`.
582582

583-
For example, the configuration metadata for subsystem A may refer to a DataSource by
584-
the name of `subsystemA-dataSource`. The configuration metadata for subsystem B may refer to
583+
For example, the configuration metadata for subsystem A may refer to a DataSource by the
584+
name of `subsystemA-dataSource`. The configuration metadata for subsystem B may refer to
585585
a DataSource by the name of `subsystemB-dataSource`. When composing the main application
586586
that uses both these subsystems, the main application refers to the DataSource by the
587-
name of `myApp-dataSource`. To have all three names refer to the same object, you can add
588-
the following alias definitions to the configuration metadata:
587+
name of `myApp-dataSource`. To have all three names refer to the same object, you can
588+
add the following alias definitions to the configuration metadata:
589589

590590
====
591591
[source,xml,indent=0]
592592
[subs="verbatim,quotes"]
593593
----
594-
<alias name="subsystemA-dataSource" alias="subsystemB-dataSource"/>
595-
<alias name="subsystemA-dataSource" alias="myApp-dataSource" />
594+
<alias name="myApp-dataSource" alias="subsystemA-dataSource"/>
595+
<alias name="myApp-dataSource" alias="subsystemB-dataSource"/>
596596
----
597597
====
598598

@@ -7231,7 +7231,7 @@ a number of aliases for a bean:
72317231
@Configuration
72327232
public class AppConfig {
72337233
7234-
@Bean(name = { "dataSource", "subsystemA-dataSource", "subsystemB-dataSource" })
7234+
@Bean({"dataSource", "subsystemA-dataSource", "subsystemB-dataSource"})
72357235
public DataSource dataSource() {
72367236
// instantiate, configure and return DataSource bean...
72377237
}

0 commit comments

Comments
 (0)