Class GenericScope
java.lang.Object
org.springframework.cloud.context.scope.GenericScope
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor,org.springframework.beans.factory.config.Scope,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
- Direct Known Subclasses:
RefreshScope,ThreadScope
public class GenericScope
extends Object
implements org.springframework.beans.factory.config.Scope, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.beans.factory.DisposableBean
A generic Scope implementation.
- Since:
- 3.1
- Author:
- Dave Syer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA factory bean with a locked scope. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()protected booleanDestroys the named bean (i.e.A map of bean name to errors when instantiating the bean.protected ReadWriteLockprotected StringgetName()voidpostProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) voidpostProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) voidregisterDestructionCallback(String name, Runnable callback) voidManual override for the serialization ID that will be used to identify the bean factory.voidThe name of this scope.voidsetScopeCache(ScopeCache cache) The cache implementation to use for bean instances in this scope.
-
Constructor Details
-
GenericScope
public GenericScope()
-
-
Method Details
-
setId
Manual override for the serialization ID that will be used to identify the bean factory. The default is a unique key based on the bean names in the bean factory.- Parameters:
id- The ID to set.
-
setScopeCache
The cache implementation to use for bean instances in this scope.- Parameters:
cache- The cache to use.
-
getErrors
A map of bean name to errors when instantiating the bean.- Returns:
- The errors accumulated since the latest destroy.
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
destroy
Destroys the named bean (i.e. flushes it from the cache by default).- Parameters:
name- The bean name to flush.- Returns:
- True if the bean was already cached; false otherwise.
-
get
- Specified by:
getin interfaceorg.springframework.beans.factory.config.Scope
-
getConversationId
- Specified by:
getConversationIdin interfaceorg.springframework.beans.factory.config.Scope
-
registerDestructionCallback
- Specified by:
registerDestructionCallbackin interfaceorg.springframework.beans.factory.config.Scope
-
remove
- Specified by:
removein interfaceorg.springframework.beans.factory.config.Scope
-
resolveContextualObject
- Specified by:
resolveContextualObjectin interfaceorg.springframework.beans.factory.config.Scope
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
postProcessBeanFactoryin interfaceorg.springframework.beans.factory.config.BeanFactoryPostProcessor- Throws:
org.springframework.beans.BeansException
-
postProcessBeanDefinitionRegistry
public void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException - Specified by:
postProcessBeanDefinitionRegistryin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor- Throws:
org.springframework.beans.BeansException
-
getName
-
setName
The name of this scope. Default "generic".- Parameters:
name- The name value to set.
-
getLock
-