Merge branch '1.5.x'

This commit is contained in:
Stephane Nicoll
2017-06-02 14:57:08 +02:00
3 changed files with 54 additions and 1 deletions

View File

@@ -30,6 +30,23 @@ import org.springframework.context.annotation.Conditional;
/**
* {@link Conditional} that only matches when the specified bean classes and/or names are
* already contained in the {@link BeanFactory}.
* When placed on a {@code @Bean} method, the bean class default to the return type of
* the factory method:
*
* <pre class="code">
* &#064;Configuration
* public class MyAutoConfiguration {
*
* &#064;ConditionalOnBean
* &#064;Bean
* public MyService myService() {
* ...
* }
*
* }</pre>
* <p>
* In the sample above the condition will match if a bean of type {@code MyService} is
* already contained in the {@link BeanFactory}.
* <p>
* The condition can only match the bean definitions that have been processed by the
* application context so far and, as such, it is strongly recommended to use this

View File

@@ -31,6 +31,24 @@ import org.springframework.context.annotation.Conditional;
* {@link Conditional} that only matches when the specified bean classes and/or names are
* not already contained in the {@link BeanFactory}.
* <p>
* When placed on a {@code @Bean} method, the bean class default to the return type of
* the factory method:
*
* <pre class="code">
* &#064;Configuration
* public class MyAutoConfiguration {
*
* &#064;ConditionalOnMissingBean
* &#064;Bean
* public MyService myService() {
* ...
* }
*
* }</pre>
* <p>
* In the sample above the condition will match if no bean of type {@code MyService} is
* already contained in the {@link BeanFactory}.
* <p>
* The condition can only match the bean definitions that have been processed by the
* application context so far and, as such, it is strongly recommended to use this
* condition on auto-configuration classes only. If a candidate bean may be created by