Commit 680cdb47 authored by Phillip Webb's avatar Phillip Webb

Merge pull request #18490 from izeye

* pr/18490:
  Polish

Closes gh-18490
parents 4cfbe7fd 701bd0dd
...@@ -48,7 +48,7 @@ import org.springframework.context.annotation.Import; ...@@ -48,7 +48,7 @@ import org.springframework.context.annotation.Import;
* <p> * <p>
* This configuration class is active only when the RabbitMQ and Spring AMQP client * This configuration class is active only when the RabbitMQ and Spring AMQP client
* libraries are on the classpath. * libraries are on the classpath.
* <P> * <p>
* Registers the following beans: * Registers the following beans:
* <ul> * <ul>
* <li>{@link org.springframework.amqp.rabbit.core.RabbitTemplate RabbitTemplate} if there * <li>{@link org.springframework.amqp.rabbit.core.RabbitTemplate RabbitTemplate} if there
......
...@@ -24,7 +24,7 @@ import org.springframework.core.io.ResourceLoader; ...@@ -24,7 +24,7 @@ import org.springframework.core.io.ResourceLoader;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
* Initialize the Spring Batch schema (ignoring errors, so should be idempotent). * Initialize the Spring Batch schema (ignoring errors, so it should be idempotent).
* *
* @author Dave Syer * @author Dave Syer
* @author Vedran Pavic * @author Vedran Pavic
......
...@@ -34,7 +34,7 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate; ...@@ -34,7 +34,7 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate;
* <p> * <p>
* Registers a {@link MongoTemplate} and {@link GridFsTemplate} beans if no other beans of * Registers a {@link MongoTemplate} and {@link GridFsTemplate} beans if no other beans of
* the same type are configured. * the same type are configured.
* <P> * <p>
* Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects * Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects
* to the {@literal test} database. * to the {@literal test} database.
* *
......
...@@ -49,7 +49,7 @@ import org.springframework.data.mongodb.gridfs.ReactiveGridFsTemplate; ...@@ -49,7 +49,7 @@ import org.springframework.data.mongodb.gridfs.ReactiveGridFsTemplate;
* <p> * <p>
* Registers a {@link ReactiveMongoTemplate} bean if no other bean of the same type is * Registers a {@link ReactiveMongoTemplate} bean if no other bean of the same type is
* configured. * configured.
* <P> * <p>
* Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects * Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects
* to the {@literal test} database. * to the {@literal test} database.
* *
......
...@@ -1301,7 +1301,7 @@ By default, Spring Boot picks up the native configuration from its default locat ...@@ -1301,7 +1301,7 @@ By default, Spring Boot picks up the native configuration from its default locat
=== Configure Logback for Logging === Configure Logback for Logging
If you need to apply customizations to logback beyond those that can be achieved with `application.properties`, you'll need to add a standard logback configuration file. If you need to apply customizations to logback beyond those that can be achieved with `application.properties`, you'll need to add a standard logback configuration file.
You can add a `logback.xml` file to the root of your classpath for logback to find. You can add a `logback.xml` file to the root of your classpath for logback to find.
You can also use `logback-spring.xml` if you want to use the <<spring-boot-features.adoc#boot-features-logback-extensions,Spring Boot Logback extensions>>) You can also use `logback-spring.xml` if you want to use the <<spring-boot-features.adoc#boot-features-logback-extensions,Spring Boot Logback extensions>>.
TIP: The Logback documentation has a https://logback.qos.ch/manual/configuration.html[dedicated section that covers configuration] in some detail. TIP: The Logback documentation has a https://logback.qos.ch/manual/configuration.html[dedicated section that covers configuration] in some detail.
......
...@@ -27,7 +27,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; ...@@ -27,7 +27,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
/** /**
* {@link BeanFactoryPostProcessor} to set lazy-init on bean definitions that not * {@link BeanFactoryPostProcessor} to set lazy-init on bean definitions that are not
* {@link LazyInitializationExcludeFilter excluded} and have not already had a value * {@link LazyInitializationExcludeFilter excluded} and have not already had a value
* explicitly set. * explicitly set.
* *
...@@ -57,8 +57,11 @@ public final class LazyInitializationBeanFactoryPostProcessor implements BeanFac ...@@ -57,8 +57,11 @@ public final class LazyInitializationBeanFactoryPostProcessor implements BeanFac
Collection<LazyInitializationExcludeFilter> filters, String beanName, Collection<LazyInitializationExcludeFilter> filters, String beanName,
AbstractBeanDefinition beanDefinition) { AbstractBeanDefinition beanDefinition) {
Boolean lazyInit = beanDefinition.getLazyInit(); Boolean lazyInit = beanDefinition.getLazyInit();
if (lazyInit != null) {
return;
}
Class<?> beanType = getBeanType(beanFactory, beanName); Class<?> beanType = getBeanType(beanFactory, beanName);
if (lazyInit == null && !isExcluded(filters, beanName, beanDefinition, beanType)) { if (!isExcluded(filters, beanName, beanDefinition, beanType)) {
beanDefinition.setLazyInit(true); beanDefinition.setLazyInit(true);
} }
} }
......
...@@ -21,16 +21,16 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; ...@@ -21,16 +21,16 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
/** /**
* Filter that can be used to exclude beans definitions from having their * Filter that can be used to exclude beans definitions from having their
* {@link AbstractBeanDefinition#setLazyInit(boolean) lazy-int} set by the * {@link AbstractBeanDefinition#setLazyInit(boolean) lazy-init} set by the
* {@link LazyInitializationBeanFactoryPostProcessor}. * {@link LazyInitializationBeanFactoryPostProcessor}.
* <P> * <p>
* Primarily intended to allow downstream projects to deal with edge-cases in which it is * Primarily intended to allow downstream projects to deal with edge-cases in which it is
* not easy to support lazy-loading (such as in DSLs that dynamically create additional * not easy to support lazy-loading (such as in DSLs that dynamically create additional
* beans). Adding an instance of this filter to the application context can be used for * beans). Adding an instance of this filter to the application context can be used for
* these edge cases. * these edge cases.
* <P> * <p>
* A typical example would be something like this: * A typical example would be something like this:
* <P> * <p>
* <pre><code> * <pre><code>
* &#64;Bean * &#64;Bean
* public static LazyInitializationExcludeFilter integrationLazyInitializationExcludeFilter() { * public static LazyInitializationExcludeFilter integrationLazyInitializationExcludeFilter() {
...@@ -38,7 +38,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; ...@@ -38,7 +38,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* }</code></pre> * }</code></pre>
* <p> * <p>
* NOTE: Beans of this type will be instantiated very early in the spring application * NOTE: Beans of this type will be instantiated very early in the spring application
* lifecycle so should generally be declared static and not have any dependencies. * lifecycle so they should generally be declared static and not have any dependencies.
* *
* @author Tyler Van Gorder * @author Tyler Van Gorder
* @author Philip Webb * @author Philip Webb
...@@ -49,11 +49,11 @@ public interface LazyInitializationExcludeFilter { ...@@ -49,11 +49,11 @@ public interface LazyInitializationExcludeFilter {
/** /**
* Returns {@code true} if the specified bean definition should be excluded from * Returns {@code true} if the specified bean definition should be excluded from
* having {@code lazy-int} automatically set. * having {@code lazy-init} automatically set.
* @param beanName the bean name * @param beanName the bean name
* @param beanDefinition the bean definition * @param beanDefinition the bean definition
* @param beanType the bean type * @param beanType the bean type
* @return {@code true} if {@code lazy-int} should not be automatically set * @return {@code true} if {@code lazy-init} should not be automatically set
*/ */
boolean isExcluded(String beanName, BeanDefinition beanDefinition, Class<?> beanType); boolean isExcluded(String beanName, BeanDefinition beanDefinition, Class<?> beanType);
......
...@@ -22,7 +22,7 @@ import org.springframework.core.env.PropertySource; ...@@ -22,7 +22,7 @@ import org.springframework.core.env.PropertySource;
/** /**
* Strategy used to provide a mapping between a {@link PropertySource} and a * Strategy used to provide a mapping between a {@link PropertySource} and a
* {@link ConfigurationPropertySource}. * {@link ConfigurationPropertySource}.
* <P> * <p>
* Mappings should be provided for both {@link ConfigurationPropertyName * Mappings should be provided for both {@link ConfigurationPropertyName
* ConfigurationPropertyName} types and {@code String} based names. This allows the * ConfigurationPropertyName} types and {@code String} based names. This allows the
* {@link SpringConfigurationPropertySource} to first attempt any direct mappings (i.e. * {@link SpringConfigurationPropertySource} to first attempt any direct mappings (i.e.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment