From 80b8382f00dcb2eb0a3fee8073f8de92aa57d09e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 25 Nov 2018 21:27:49 +0100 Subject: [PATCH] Revised alias definition example in reference documentation Issue: SPR-17536 --- src/docs/asciidoc/core/core-beans.adoc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index 25c9d47ebd4..57b68dacc82 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -565,9 +565,9 @@ itself. Specifying all aliases where the bean is actually defined is not always adequate, however. It is sometimes desirable to introduce an alias for a bean that is defined elsewhere. This is commonly the case in large systems where configuration is split -amongst each subsystem, with each subsystem having its own set of object definitions. In -XML-based configuration metadata, you can use the `` element to accomplish this. -The following example shows how to do so: +amongst each subsystem, with each subsystem having its own set of object definitions. +In XML-based configuration metadata, you can use the `` element to accomplish +this. The following example shows how to do so: ==== [source,xml,indent=0] @@ -580,19 +580,19 @@ The following example shows how to do so: In this case, a bean (in the same container) named `fromName` may also, after the use of this alias definition, be referred to as `toName`. -For example, the configuration metadata for subsystem A may refer to a DataSource by -the name of `subsystemA-dataSource`. The configuration metadata for subsystem B may refer to +For example, the configuration metadata for subsystem A may refer to a DataSource by the +name of `subsystemA-dataSource`. The configuration metadata for subsystem B may refer to a DataSource by the name of `subsystemB-dataSource`. When composing the main application that uses both these subsystems, the main application refers to the DataSource by the -name of `myApp-dataSource`. To have all three names refer to the same object, you can add -the following alias definitions to the configuration metadata: +name of `myApp-dataSource`. To have all three names refer to the same object, you can +add the following alias definitions to the configuration metadata: ==== [source,xml,indent=0] [subs="verbatim,quotes"] ---- - - + + ---- ==== @@ -7231,7 +7231,7 @@ a number of aliases for a bean: @Configuration public class AppConfig { - @Bean(name = { "dataSource", "subsystemA-dataSource", "subsystemB-dataSource" }) + @Bean({"dataSource", "subsystemA-dataSource", "subsystemB-dataSource"}) public DataSource dataSource() { // instantiate, configure and return DataSource bean... }