Consistent use of SCOPE_PROTOTYPE and SCOPE_SINGLETON constants

Closes gh-19905
This commit is contained in:
Sam Brannen
2019-11-24 13:49:43 +01:00
parent 7bed4f36da
commit 59e250c93c
23 changed files with 138 additions and 126 deletions

View File

@@ -16,10 +16,10 @@
package example.scannable_scoped;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.stereotype.Component;
@Component
@MyScope(BeanDefinition.SCOPE_PROTOTYPE)
@MyScope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class CustomScopeAnnotationBean {
}

View File

@@ -19,11 +19,11 @@ package example.scannable_scoped;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.ScopedProxyMode;
@Retention(RetentionPolicy.RUNTIME)
public @interface MyScope {
String value() default BeanDefinition.SCOPE_SINGLETON;
String value() default ConfigurableBeanFactory.SCOPE_SINGLETON;
ScopedProxyMode proxyMode() default ScopedProxyMode.DEFAULT;
}