Spring Data for VMware GemFire
Class AbstractAnnotationConfigSupport
java.lang.Object
org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.context.EnvironmentAware
- Direct Known Subclasses:
AbstractCacheConfiguration,AddCacheServerConfiguration,AddPoolConfiguration,ApacheShiroSecurityConfiguration,AuthenticationBeanConfiguration,AutoRegionLookupConfiguration,CachingDefinedRegionsConfiguration,CachingDefinedRegionsConfiguration.AbstractCacheNameResolver,ClusterConfigurationConfiguration,ClusterDefinedRegionsConfiguration,CompressionConfiguration,ContinuousQueryConfiguration,DiskStoreConfiguration,EmbeddedServiceConfigurationSupport,EntityDefinedRegionsConfiguration,EvictionConfiguration,ExpirationConfiguration,GatewayReceiverConfiguration,GatewaySenderBeanFactoryPostProcessor,GatewaySenderConfiguration,GemfireCacheTransactionsConfiguration,LocatorApplicationConfiguration,OffHeapConfiguration.OffHeapBeanFactoryPostProcessor,PdxConfiguration
public abstract class AbstractAnnotationConfigSupport
extends Object
implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware
An abstract base class encapsulating functionality common to all Spring Data for Apache Geode (SDG) annotations
and configuration classes used to configure Apache Geode objects using Spring Data for Apache Geode.
- Since:
- 1.9.0
- See Also:
-
ClassLoaderAnnotationAnnotatedElementBeanClassLoaderAwareBeanFactoryBeanFactoryAwareAnnotatedBeanDefinitionConfigurableBeanFactoryAbstractBeanDefinitionBeanDefinitionRegistryEnvironmentAwareAnnotationAttributesEnvironmentAnnotationMetadataMethodMetadataEvaluationContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceAbstractAnnotationConfigSupport.TypeResolveris aFunctionalInterfacedefining a contract to encapsulate logic used to resolve a particulartype. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Supplier<ClassLoader>protected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance ofAbstractAnnotationConfigSupport.AbstractAnnotationConfigSupport(org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofAbstractAnnotationConfigSupportinitialized with the given, non-requiredBeanFactory. -
Method Summary
Modifier and TypeMethodDescriptionarrayOfPropertyNamesFor(String propertyNamePrefix) arrayOfPropertyNamesFor(String propertyNamePrefix, String propertyNameSuffix) protected StringasArrayProperty(String propertyNamePrefix, int index, String propertyNameSuffix) protected StringcacheClientProperty(String propertyNameSuffix) protected StringcacheCompressionProperty(String propertyNameSuffix) protected StringcacheOffHeapProperty(String propertyNameSuffix) protected StringcachePeerProperty(String propertyNameSuffix) protected StringcacheProperty(String propertyNameSuffix) protected StringcacheServerProperty(String propertyNameSuffix) protected StringclusterProperty(String propertyNameSuffix) protected StringdiskStoreProperty(String propertyNameSuffix) protected StringentitiesProperty(String propertyNameSuffix) protected StringgatewayReceiverProperty(String propertyNameSuffix) protected StringgatewaySenderProperty(String propertyNameSuffix) protected org.springframework.core.annotation.AnnotationAttributesgetAnnotationAttributes(Annotation annotation) Returns theAnnotationAttributesfor the givenAnnotation.protected org.springframework.core.annotation.AnnotationAttributesgetAnnotationAttributes(org.springframework.core.type.AnnotationMetadata importingClassMetadata) ReturnsAnnotationAttributesfor the declaredgetAnnotationTypeName().protected org.springframework.core.annotation.AnnotationAttributesgetAnnotationAttributes(org.springframework.core.type.AnnotationMetadata importingClassMetadata, String annotationName) protected abstract Class<? extends Annotation>Returns the cache applicationAnnotationtype pertaining to this configuration.protected StringReturns the fully-qualifiedclass nameof the cache applicationAnnotationtype.protected StringReturns the simpleclass nameof the cache applicationAnnotationtype.protected ClassLoaderReturns a reference to theClassLoaderuse by the SpringBeanFactoryto load classes for bean definitions.protected org.springframework.beans.factory.BeanFactoryReturns a reference to the SpringBeanFactoryin the current application context.protected org.springframework.core.env.EnvironmentReturns a reference to the SpringEnvironment.protected org.springframework.expression.EvaluationContextReturns a reference to theEvaluationContextused to evaluate SpEL expressions.protected org.slf4j.LoggerReturns a reference to theLoggerused by this class to logmessages.static booleanDetermines whether the givenNumberhas value.static booleanDetermines whether the givenObjecthas value.static booleanDetermines whether the givenStringhas value.protected StringhttpServiceProperty(String propertyNameSuffix) protected booleanisAnnotationPresent(org.springframework.core.type.AnnotationMetadata importingClassMetadata) Determines whether the giventype meta-datafor a particularClassis annotated with the declaredgetAnnotationTypeName().protected booleanisAnnotationPresent(org.springframework.core.type.AnnotationMetadata importingClassMetadata, String annotationName) Determines whether the giventype meta-datafor a particularClassis annotated with the givenAnnotationdefined byname.protected booleanNull-safe method used to determine whether the givenbeanis a Spring container provided infrastructure bean.protected booleanisNotInfrastructureBean(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method used to determine whether the bean defined by the givenBeanDefinitionis a Spring container provided infrastructure bean.protected booleanisNotInfrastructureClass(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method used to determine whether the bean defined by the givenBeanDefinitionis a Spring container infrastructure bean based on the bean's class name.protected booleanisNotInfrastructureRole(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method to determines whether the bean defined by the givenBeanDefinitionis a Spring container infrastructure bean based on the bean's role.protected booleanisUserLevelMethod(Method method) Determines whether the givenMethodwas declared and defined by the user.protected StringlocatorProperty(String propertyNameSuffix) protected voidprotected voidprotected voidprotected voidprotected StringloggingProperty(String propertyNameSuffix) protected voidprotected voidprotected voidlogWarning(String message, Object... args) protected voidlogWarning(Supplier<String> message) protected StringmanagementProperty(String propertyNameSuffix) protected StringmanagerProperty(String propertyNameSuffix) protected StringmemcachedServiceProperty(String propertyNameSuffix) protected StringnamedCacheServerProperty(String name, String propertyNameSuffix) protected StringnamedDiskStoreProperty(String name, String propertyNameSuffix) protected StringnamedGatewaySenderProperty(String name, String propertyNameSuffix) protected StringnamedPoolProperty(String name, String propertyNameSuffix) protected org.springframework.expression.EvaluationContextnewEvaluationContext(org.springframework.beans.factory.BeanFactory beanFactory) Constructs, configures and initializes a new instance of anEvaluationContext.protected org.slf4j.LoggerConstructs a new instance ofLoggerto log statements printed by Spring Data for Apache Geode.protected StringpdxProperty(String propertyNameSuffix) protected StringpoolProperty(String propertyNameSuffix) protected StringpropertyName(String propertyNameSuffix) Returns the fully-qualifiedproperty name.protected org.springframework.beans.factory.support.AbstractBeanDefinitionregister(org.springframework.beans.factory.support.AbstractBeanDefinition beanDefinition) protected org.springframework.beans.factory.support.AbstractBeanDefinitionregister(org.springframework.beans.factory.support.AbstractBeanDefinition beanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Registers theAbstractBeanDefinitionwith the givenBeanDefinitionRegistryusing a generatedbean name.protected <T> TrequireProperty(String propertyName, Class<T> type) protected <A extends Annotation>
AresolveAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType) resolveBeanClass(org.springframework.beans.factory.config.BeanDefinition beanDefinition, ClassLoader classLoader) Resolves thetypeof the bean defined by the givenBeanDefinition.resolveBeanClass(org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Resolves thetypeof the bean defined by the givenBeanDefinition.resolveBeanClass(org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Resolves thetypeof the bean defined by the givenBeanDefinition.protected ClassLoaderprotected ClassLoaderresolveBeanClassLoader(org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Attempts to resolve theClassLoaderused by theConfigurableBeanFactoryto loadClassdefinitions of the beans created by the factory.protected ClassLoaderresolveBeanClassLoader(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Attempts to resolve theClassLoaderused by theBeanDefinitionRegistryto loadClassdefinitions of the beans defined in the registry.resolveBeanClassName(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Resolves the class type name of the bean defined by the givenBeanDefinition.protected BooleanresolveProperty(String propertyName, Boolean defaultValue) protected <T> TresolveProperty(String propertyName, Class<T> targetType) Attempts to resolve the property with the givennamefrom the SpringEnvironment.protected <T> TresolveProperty(String propertyName, Class<T> targetType, T defaultValue) Attempts to resolve the property with the givennamefrom the SpringEnvironment.protected DoubleresolveProperty(String propertyName, Double defaultValue) protected FloatresolveProperty(String propertyName, Float defaultValue) protected IntegerresolveProperty(String propertyName, Integer defaultValue) protected LongresolveProperty(String propertyName, Long defaultValue) protected StringresolveProperty(String propertyName, String defaultValue) protected <T> Class<T>safeResolveType(AbstractAnnotationConfigSupport.TypeResolver<T> typeResolver) Safely resolves atypereturned by the givenAbstractAnnotationConfigSupport.TypeResolverwhere thetyperesolution might result in aClassNotFoundExceptionorNoClassDefFoundError.protected StringsecurityProperty(String propertyNameSuffix) protected StringserviceProperty(String propertyNameSuffix) voidsetBeanClassLoader(ClassLoader beanClassLoader) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetEnvironment(org.springframework.core.env.Environment environment) Sets a reference to the SpringEnvironment.protected StringsslProperty(String propertyNameSuffix) protected StringstatsProperty(String propertyNameSuffix)
-
Field Details
-
INFRASTRUCTURE_ROLES
-
ORG_SPRINGFRAMEWORK_DATA_GEMFIRE_PACKAGE
- See Also:
-
ORG_SPRINGFRAMEWORK_PACKAGE
- See Also:
-
SPRING_DATA_GEMFIRE_PROPERTY_PREFIX
- See Also:
-
CURRENT_THREAD_CONTEXT_CLASS_LOADER
-
-
Constructor Details
-
AbstractAnnotationConfigSupport
public AbstractAnnotationConfigSupport()Constructs a new instance ofAbstractAnnotationConfigSupport. -
AbstractAnnotationConfigSupport
public AbstractAnnotationConfigSupport(@Nullable org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofAbstractAnnotationConfigSupportinitialized with the given, non-requiredBeanFactory.- Parameters:
beanFactory- reference to the SpringBeanFactory.- See Also:
-
BeanFactorynewEvaluationContext(BeanFactory)newLogger()
-
-
Method Details
-
hasValue
-
hasValue
-
hasValue
-
newEvaluationContext
protected org.springframework.expression.EvaluationContext newEvaluationContext(@Nullable org.springframework.beans.factory.BeanFactory beanFactory) Constructs, configures and initializes a new instance of anEvaluationContext.- Parameters:
beanFactory- reference to the SpringBeanFactory.- Returns:
- a new
EvaluationContext. - See Also:
-
BeanFactoryEvaluationContextgetBeanFactory()
-
newLogger
@NonNull protected org.slf4j.Logger newLogger()Constructs a new instance ofLoggerto log statements printed by Spring Data for Apache Geode.- Returns:
- a new instance of
Logger. - See Also:
-
LoggerFactory.getLogger(Class)Logger
-
isAnnotationPresent
protected boolean isAnnotationPresent(@NonNull org.springframework.core.type.AnnotationMetadata importingClassMetadata) Determines whether the giventype meta-datafor a particularClassis annotated with the declaredgetAnnotationTypeName().- Parameters:
importingClassMetadata-type meta-datafor a particularClass.- Returns:
- a boolean indicating whether the particular
Classis annotated with the declaredgetAnnotationTypeName(). - See Also:
-
isAnnotationPresent(AnnotationMetadata, String)getAnnotationTypeName()AnnotationMetadata
-
isAnnotationPresent
protected boolean isAnnotationPresent(@NonNull org.springframework.core.type.AnnotationMetadata importingClassMetadata, @NonNull String annotationName) Determines whether the giventype meta-datafor a particularClassis annotated with the givenAnnotationdefined byname.- Parameters:
importingClassMetadata-type meta-datafor a particularClass.annotationName-nameof theAnnotationof interests.- Returns:
- a boolean indicating whether the particular
Classis annotated with the givenAnnotationdefined byname. - See Also:
-
AnnotationMetadata
-
getAnnotationAttributes
@NonNull protected org.springframework.core.annotation.AnnotationAttributes getAnnotationAttributes(@NonNull Annotation annotation) Returns theAnnotationAttributesfor the givenAnnotation.- Parameters:
annotation-Annotationto get theAnnotationAttributesfor.- Returns:
- the
AnnotationAttributesfor the givenAnnotation. - See Also:
-
AnnotationAttributesAnnotation
-
getAnnotationAttributes
@NonNull protected org.springframework.core.annotation.AnnotationAttributes getAnnotationAttributes(@NonNull org.springframework.core.type.AnnotationMetadata importingClassMetadata) ReturnsAnnotationAttributesfor the declaredgetAnnotationTypeName().- Parameters:
importingClassMetadata-type meta-datafor a particularClass.- Returns:
AnnotationAttributesfor the declaredgetAnnotationTypeName().- See Also:
-
AnnotationAttributesAnnotationMetadatagetAnnotationAttributes(AnnotationMetadata, String)getAnnotationTypeName()
-
getAnnotationAttributes
@NonNull protected org.springframework.core.annotation.AnnotationAttributes getAnnotationAttributes(@NonNull org.springframework.core.type.AnnotationMetadata importingClassMetadata, @NonNull String annotationName) - Parameters:
importingClassMetadata-type meta-datafor a particularClass.annotationName-nameof theAnnotationof interests.- Returns:
AnnotationAttributesfor the givennamedAnnotation.- See Also:
-
AnnotationAttributesAnnotationMetadata
-
getAnnotationType
Returns the cache applicationAnnotationtype pertaining to this configuration.- Returns:
- the cache application
Annotationtype used by this application.
-
getAnnotationTypeName
Returns the fully-qualifiedclass nameof the cache applicationAnnotationtype.- Returns:
- the fully-qualified
class nameof the cache applicationAnnotationtype. - See Also:
-
getAnnotationTypeSimpleName
Returns the simpleclass nameof the cache applicationAnnotationtype.- Returns:
- the simple
class nameof the cache applicationAnnotationtype. - See Also:
-
isNotInfrastructureBean
Null-safe method used to determine whether the givenbeanis a Spring container provided infrastructure bean.- Parameters:
bean-Objectto evaluate.- Returns:
- true iff the
beanis not a Spring container provided infrastructure bean. - See Also:
-
isNotInfrastructureClass(String)Object.getClass()Class.getName()
-
isNotInfrastructureBean
protected boolean isNotInfrastructureBean(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method used to determine whether the bean defined by the givenBeanDefinitionis a Spring container provided infrastructure bean.- Parameters:
beanDefinition-BeanDefinitionto evaluate.- Returns:
- true iff the bean defined by the given
BeanDefinitionis not a Spring container provided infrastructure bean. - See Also:
-
isNotInfrastructureClass
protected boolean isNotInfrastructureClass(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method used to determine whether the bean defined by the givenBeanDefinitionis a Spring container infrastructure bean based on the bean's class name.- Parameters:
beanDefinition-BeanDefinitionof the bean to evaluate.- Returns:
- true iff the bean defined in the given
BeanDefinitionis not a Spring container infrastructure bean. Returns false if the bean class name cannot be resolved. - See Also:
-
BeanDefinitionresolveBeanClassName(BeanDefinition)isNotInfrastructureClass(String)
-
isNotInfrastructureRole
protected boolean isNotInfrastructureRole(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method to determines whether the bean defined by the givenBeanDefinitionis a Spring container infrastructure bean based on the bean's role.- Parameters:
beanDefinition-BeanDefinitionof the bean to evaluate.- Returns:
- true iff the bean defined in the given
BeanDefinitionis not a Spring container infrastructure bean. - See Also:
-
BeanDefinition
-
isUserLevelMethod
Determines whether the givenMethodwas declared and defined by the user. AMethodis considered a user-levelMethodif theMethodis not anObjectclass method, is aBridge Methodor is notMethod.isSynthetic()nor a Groovy method. -
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
getBeanClassLoader
Returns a reference to theClassLoaderuse by the SpringBeanFactoryto load classes for bean definitions.- Returns:
- the
ClassLoaderused by the SpringBeanFactoryto load classes for bean definitions. - See Also:
-
resolveBeanClassLoader
- Returns:
- the configured
ClassLoaderor theThread Context ClassLoader. - See Also:
-
setBeanFactory
public void setBeanFactory(@Nullable org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
getBeanFactory
@NonNull protected org.springframework.beans.factory.BeanFactory getBeanFactory()Returns a reference to the SpringBeanFactoryin the current application context.- Returns:
- a reference to the Spring
BeanFactory. - Throws:
IllegalStateException- if the SpringBeanFactorywas not properly configured.- See Also:
-
BeanFactory
-
setEnvironment
public void setEnvironment(@Nullable org.springframework.core.env.Environment environment) Sets a reference to the SpringEnvironment.- Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware- Parameters:
environment- SpringEnvironment.- See Also:
-
EnvironmentAware.setEnvironment(Environment)Environment
-
getEnvironment
@Nullable protected org.springframework.core.env.Environment getEnvironment()Returns a reference to the SpringEnvironment.- Returns:
- a reference to the Spring
Environment. - See Also:
-
Environment
-
getEvaluationContext
@NonNull protected org.springframework.expression.EvaluationContext getEvaluationContext()Returns a reference to theEvaluationContextused to evaluate SpEL expressions.- Returns:
- a reference to the
EvaluationContextused to evaluate SpEL expressions. - See Also:
-
EvaluationContext
-
getLogger
@NonNull protected org.slf4j.Logger getLogger()Returns a reference to theLoggerused by this class to logmessages.- Returns:
- a reference to the
Loggerused by this class to logmessages. - See Also:
-
Log
-
logDebug
-
logDebug
- Parameters:
message-Suppliercontaining themessageand arguments to log.- See Also:
-
Log.isDebugEnabled()Log.debug(Object)getLogger()
-
logInfo
-
logInfo
- Parameters:
message-Suppliercontaining themessageand arguments to log.- See Also:
-
Log.isInfoEnabled()Log.info(Object)getLogger()
-
logWarning
-
logWarning
- Parameters:
message-Suppliercontaining themessageand arguments to log.- See Also:
-
Log.isWarnEnabled()Log.warn(Object)getLogger()
-
logError
-
logError
- Parameters:
message-Suppliercontaining themessageand arguments to log.- See Also:
-
Log.isErrorEnabled()Log.error(Object)getLogger()
-
register
@NonNull protected org.springframework.beans.factory.support.AbstractBeanDefinition register(@NonNull org.springframework.beans.factory.support.AbstractBeanDefinition beanDefinition) - Parameters:
beanDefinition-AbstractBeanDefinitionto register.- Returns:
- the given
AbstractBeanDefinition. - See Also:
-
BeanFactoryAbstractBeanDefinitionBeanDefinitionRegistryBeanDefinitionReaderUtils.registerWithGeneratedName(AbstractBeanDefinition, BeanDefinitionRegistry)getBeanFactory()
-
register
@NonNull protected org.springframework.beans.factory.support.AbstractBeanDefinition register(@NonNull org.springframework.beans.factory.support.AbstractBeanDefinition beanDefinition, @Nullable org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Registers theAbstractBeanDefinitionwith the givenBeanDefinitionRegistryusing a generatedbean name.- Parameters:
beanDefinition-AbstractBeanDefinitionto register.registry-BeanDefinitionRegistryused to register theAbstractBeanDefinition.- Returns:
- the given
AbstractBeanDefinition. - See Also:
-
AbstractBeanDefinitionBeanDefinitionRegistryBeanDefinitionReaderUtils.registerWithGeneratedName(AbstractBeanDefinition, BeanDefinitionRegistry)
-
arrayOfPropertyNamesFor
-
arrayOfPropertyNamesFor
-
asArrayProperty
-
cacheProperty
-
cacheClientProperty
-
cacheCompressionProperty
-
cacheOffHeapProperty
-
cachePeerProperty
-
cacheServerProperty
-
namedCacheServerProperty
-
clusterProperty
-
diskStoreProperty
-
namedDiskStoreProperty
-
entitiesProperty
-
locatorProperty
-
loggingProperty
-
managementProperty
-
managerProperty
-
pdxProperty
-
poolProperty
-
namedPoolProperty
-
securityProperty
-
sslProperty
-
statsProperty
-
serviceProperty
-
memcachedServiceProperty
-
httpServiceProperty
-
gatewayReceiverProperty
-
gatewaySenderProperty
-
namedGatewaySenderProperty
-
propertyName
Returns the fully-qualifiedproperty name. The fully qualifiedproperty nameconsists of theproperty nameconcatenated with thepropertyNameSuffix.- Parameters:
propertyNameSuffix-Stringcontaining the property name suffix concatenated with thebase property name.- Returns:
- the fully-qualified
property name. - See Also:
-
requireProperty
Resolves the value for the given property identified bynamefrom the SpringEnvironmentas an instance of the specifiedtype.- Type Parameters:
T-Classtype of thepropertyName property'sassigned value.- Parameters:
propertyName-Stringcontaining the name of the required property to resolve.type-Classtype of the property's assigned value.- Returns:
- the assigned value of the
namedproperty. - Throws:
IllegalArgumentException- if the property has not been assigned a value. ForStringvalues, this also means the value cannot beempty. For non-Stringvalues, this means the value must not be null.- See Also:
-
resolveAnnotation
protected <A extends Annotation> A resolveAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType) - Type Parameters:
A-Subclass typeof the resolvedAnnotation.- Parameters:
annotatedElement-AnnotatedElementfrom which to resolve theAnnotation.annotationType-typeof theAnnotationto resolve from theAnnotatedElement.- Returns:
- the resolved
Annotation. - See Also:
-
resolveBeanClass
protected Optional<Class<?>> resolveBeanClass(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition, @Nullable org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Resolves thetypeof the bean defined by the givenBeanDefinition.- Parameters:
beanDefinition-BeanDefinitiondefining the bean from which thetypeis resolved.registry-BeanDefinitionRegistryused to resolve theClassLoaderused to resolve the bean'stype.- Returns:
- an
OptionalClassspecifying the resolved type of the bean. - See Also:
-
BeanDefinitionBeanDefinitionRegistryresolveBeanClassLoader(BeanDefinitionRegistry)resolveBeanClass(BeanDefinition, ClassLoader)
-
resolveBeanClass
protected Optional<Class<?>> resolveBeanClass(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition, @NonNull org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Resolves thetypeof the bean defined by the givenBeanDefinition.- Parameters:
beanDefinition-BeanDefinitiondefining the bean from which thetypeis resolved.beanFactory-ConfigurableBeanFactoryused to resolve theClassLoaderused to resolve the bean'stype.- Returns:
- an
OptionalClassspecifying the resolved type of the bean. - See Also:
-
BeanDefinitionConfigurableBeanFactoryresolveBeanClassLoader(ConfigurableBeanFactory)resolveBeanClass(BeanDefinition, ClassLoader)
-
resolveBeanClass
protected Optional<Class<?>> resolveBeanClass(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition, @Nullable ClassLoader classLoader) Resolves thetypeof the bean defined by the givenBeanDefinition.- Parameters:
beanDefinition-BeanDefinitiondefining the bean from which thetypeis resolved.classLoader-ClassLoaderused to resolve the bean'stype.- Returns:
- an
Optionalresolvedtypeof the bean. - See Also:
-
ClassLoaderBeanDefinitionAbstractBeanDefinition.resolveBeanClass(ClassLoader)ClassUtils.forName(String, ClassLoader)resolveBeanClassName(BeanDefinition)
-
resolveBeanClassLoader
@NonNull protected ClassLoader resolveBeanClassLoader(@Nullable org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Attempts to resolve theClassLoaderused by theBeanDefinitionRegistryto loadClassdefinitions of the beans defined in the registry.- Parameters:
registry-BeanDefinitionRegistryfrom which to resolve theClassLoader.- Returns:
- the resolved
ClassLoaderfrom theBeanDefinitionRegistryor thecurrent Thread'scontext ClassLoader. - See Also:
-
ConfigurableBeanFactory.getBeanClassLoader()BeanDefinitionRegistryThread.getContextClassLoader()Thread.currentThread()
-
resolveBeanClassLoader
@NonNull protected ClassLoader resolveBeanClassLoader(@Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Attempts to resolve theClassLoaderused by theConfigurableBeanFactoryto loadClassdefinitions of the beans created by the factory.- Parameters:
beanFactory-ConfigurableBeanFactoryfrom which to resolve theClassLoader.- Returns:
- the resolved
ClassLoaderfrom theConfigurableBeanFactoryor thecurrent Thread'scontext ClassLoader. - See Also:
-
ConfigurableBeanFactory.getBeanClassLoader()ConfigurableBeanFactoryThread.getContextClassLoader()Thread.currentThread()
-
resolveBeanClassName
protected Optional<String> resolveBeanClassName(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition) Resolves the class type name of the bean defined by the givenBeanDefinition. -
resolveProperty
-
resolveProperty
-
resolveProperty
-
resolveProperty
-
resolveProperty
-
resolveProperty
-
resolveProperty
Attempts to resolve the property with the givennamefrom the SpringEnvironment. -
resolveProperty
Attempts to resolve the property with the givennamefrom the SpringEnvironment.- Type Parameters:
T-Classtype of the property value.- Parameters:
propertyName-nameof the property to resolve.targetType-Classtype of the property's value.defaultValue- default value to return if the property is not defined or not set.- Returns:
- the value of the property identified by
nameor default value if the property is not defined or not set. - See Also:
-
safeResolveType
@Nullable protected <T> Class<T> safeResolveType(@NonNull AbstractAnnotationConfigSupport.TypeResolver<T> typeResolver) Safely resolves atypereturned by the givenAbstractAnnotationConfigSupport.TypeResolverwhere thetyperesolution might result in aClassNotFoundExceptionorNoClassDefFoundError.- Type Parameters:
T-Classof the type being resolved.- Parameters:
typeResolver-AbstractAnnotationConfigSupport.TypeResolverused to resolve a specifictype.- Returns:
- the resolved
typeor null if thetypereturned by theAbstractAnnotationConfigSupport.TypeResolvercould not be resolved. - See Also:
-