From b1577c28e2ae43135bff56e8a8710b1375a353b6 Mon Sep 17 00:00:00 2001 From: Thomas Risberg Date: Thu, 30 Apr 2009 04:35:30 +0000 Subject: [PATCH] removed some JavaConfig references --- spring-framework-reference/src/beans.xml | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/spring-framework-reference/src/beans.xml b/spring-framework-reference/src/beans.xml index fd56f196199..7e5e9b1a6c6 100644 --- a/spring-framework-reference/src/beans.xml +++ b/spring-framework-reference/src/beans.xml @@ -6072,26 +6072,22 @@ public class AppConfig { @Bean is a method-level annotation and a direct analog of the XML <bean/> element. The - annotation supports most of the attributes offered by + annotation supports some of the attributes offered by <bean/>, such as: init-method, destroy-method, - autowiring, - lazy-init, - dependency-check, - depends-on + autowiring and scope. + linkend="beans-factory-scopes">name.
Declaring a bean To declare a bean, simply annotate a method with the - @Bean annotation. When JavaConfig - encounters such a method, it will execute that method and register the - return value as a bean within a BeanFactory. By default, + @Bean annotation. Such a method + will be used to register a bean definition within a BeanFactory + of the type specified as the methods return value. By default, the bean name will be the same as the method name (see bean naming for details on how to customize this behavior). The following is a simple example of a @@ -6284,11 +6280,11 @@ public Service userService() { linkend="beans-factory-method-injection">lookup method injection is an advanced feature that should be comparatively rarely used. It is useful in cases where a singleton-scoped bean has - a dependency on a prototype-scoped bean. JavaConfig provides a - natural means for implementing this pattern. Note that the - example below is adapted from the example classes and configuration - in the core documentation linked above. Note that the example below is adapted from the example + classes and configuration in the core documentation linked above. +