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:
-
ClassLoader
Annotation
AnnotatedElement
BeanClassLoaderAware
BeanFactory
BeanFactoryAware
AnnotatedBeanDefinition
ConfigurableBeanFactory
AbstractBeanDefinition
BeanDefinitionRegistry
EnvironmentAware
AnnotationAttributes
Environment
AnnotationMetadata
MethodMetadata
EvaluationContext
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
AbstractAnnotationConfigSupport.TypeResolver
is aFunctionalInterface
defining a contract to encapsulate logic used to resolve a particulartype
. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final Supplier<ClassLoader>
protected static final String
protected static final String
protected static final String
-
Constructor Summary
ConstructorDescriptionConstructs a new instance ofAbstractAnnotationConfigSupport
.AbstractAnnotationConfigSupport
(org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofAbstractAnnotationConfigSupport
initialized with the given, non-requiredBeanFactory
. -
Method Summary
Modifier and TypeMethodDescriptionarrayOfPropertyNamesFor
(String propertyNamePrefix) arrayOfPropertyNamesFor
(String propertyNamePrefix, String propertyNameSuffix) protected String
asArrayProperty
(String propertyNamePrefix, int index, String propertyNameSuffix) protected String
cacheClientProperty
(String propertyNameSuffix) protected String
cacheCompressionProperty
(String propertyNameSuffix) protected String
cacheOffHeapProperty
(String propertyNameSuffix) protected String
cachePeerProperty
(String propertyNameSuffix) protected String
cacheProperty
(String propertyNameSuffix) protected String
cacheServerProperty
(String propertyNameSuffix) protected String
clusterProperty
(String propertyNameSuffix) protected String
diskStoreProperty
(String propertyNameSuffix) protected String
entitiesProperty
(String propertyNameSuffix) protected String
gatewayReceiverProperty
(String propertyNameSuffix) protected String
gatewaySenderProperty
(String propertyNameSuffix) protected org.springframework.core.annotation.AnnotationAttributes
getAnnotationAttributes
(Annotation annotation) Returns theAnnotationAttributes
for the givenAnnotation
.protected org.springframework.core.annotation.AnnotationAttributes
getAnnotationAttributes
(org.springframework.core.type.AnnotationMetadata importingClassMetadata) ReturnsAnnotationAttributes
for the declaredgetAnnotationTypeName()
.protected org.springframework.core.annotation.AnnotationAttributes
getAnnotationAttributes
(org.springframework.core.type.AnnotationMetadata importingClassMetadata, String annotationName) protected abstract Class<? extends Annotation>
Returns the cache applicationAnnotation
type pertaining to this configuration.protected String
Returns the fully-qualifiedclass name
of the cache applicationAnnotation
type.protected String
Returns the simpleclass name
of the cache applicationAnnotation
type.protected ClassLoader
Returns a reference to theClassLoader
use by the SpringBeanFactory
to load classes for bean definitions.protected org.springframework.beans.factory.BeanFactory
Returns a reference to the SpringBeanFactory
in the current application context.protected org.springframework.core.env.Environment
Returns a reference to the SpringEnvironment
.protected org.springframework.expression.EvaluationContext
Returns a reference to theEvaluationContext
used to evaluate SpEL expressions.protected org.slf4j.Logger
Returns a reference to theLogger
used by this class to logmessages
.static boolean
Determines whether the givenNumber
has value.static boolean
Determines whether the givenObject
has value.static boolean
Determines whether the givenString
has value.protected String
httpServiceProperty
(String propertyNameSuffix) protected boolean
isAnnotationPresent
(org.springframework.core.type.AnnotationMetadata importingClassMetadata) Determines whether the giventype meta-data
for a particularClass
is annotated with the declaredgetAnnotationTypeName()
.protected boolean
isAnnotationPresent
(org.springframework.core.type.AnnotationMetadata importingClassMetadata, String annotationName) Determines whether the giventype meta-data
for a particularClass
is annotated with the givenAnnotation
defined byname
.protected boolean
Null-safe method used to determine whether the givenbean
is a Spring container provided infrastructure bean.protected boolean
isNotInfrastructureBean
(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method used to determine whether the bean defined by the givenBeanDefinition
is a Spring container provided infrastructure bean.protected boolean
isNotInfrastructureClass
(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method used to determine whether the bean defined by the givenBeanDefinition
is a Spring container infrastructure bean based on the bean's class name.protected boolean
isNotInfrastructureRole
(org.springframework.beans.factory.config.BeanDefinition beanDefinition) Null-safe method to determines whether the bean defined by the givenBeanDefinition
is a Spring container infrastructure bean based on the bean's role.protected boolean
isUserLevelMethod
(Method method) Determines whether the givenMethod
was declared and defined by the user.protected String
locatorProperty
(String propertyNameSuffix) protected void
protected void
protected void
protected void
protected String
loggingProperty
(String propertyNameSuffix) protected void
protected void
protected void
logWarning
(String message, Object... args) protected void
logWarning
(Supplier<String> message) protected String
managementProperty
(String propertyNameSuffix) protected String
managerProperty
(String propertyNameSuffix) protected String
memcachedServiceProperty
(String propertyNameSuffix) protected String
namedCacheServerProperty
(String name, String propertyNameSuffix) protected String
namedDiskStoreProperty
(String name, String propertyNameSuffix) protected String
namedGatewaySenderProperty
(String name, String propertyNameSuffix) protected String
namedPoolProperty
(String name, String propertyNameSuffix) protected org.springframework.expression.EvaluationContext
newEvaluationContext
(org.springframework.beans.factory.BeanFactory beanFactory) Constructs, configures and initializes a new instance of anEvaluationContext
.protected org.slf4j.Logger
Constructs a new instance ofLogger
to log statements printed by Spring Data for Apache Geode.protected String
pdxProperty
(String propertyNameSuffix) protected String
poolProperty
(String propertyNameSuffix) protected String
propertyName
(String propertyNameSuffix) Returns the fully-qualifiedproperty name
.protected org.springframework.beans.factory.support.AbstractBeanDefinition
register
(org.springframework.beans.factory.support.AbstractBeanDefinition beanDefinition) protected org.springframework.beans.factory.support.AbstractBeanDefinition
register
(org.springframework.beans.factory.support.AbstractBeanDefinition beanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Registers theAbstractBeanDefinition
with the givenBeanDefinitionRegistry
using a generatedbean name
.protected <T> T
requireProperty
(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 thetype
of the bean defined by the givenBeanDefinition
.resolveBeanClass
(org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Resolves thetype
of the bean defined by the givenBeanDefinition
.resolveBeanClass
(org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Resolves thetype
of the bean defined by the givenBeanDefinition
.protected ClassLoader
protected ClassLoader
resolveBeanClassLoader
(org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Attempts to resolve theClassLoader
used by theConfigurableBeanFactory
to loadClass
definitions of the beans created by the factory.protected ClassLoader
resolveBeanClassLoader
(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Attempts to resolve theClassLoader
used by theBeanDefinitionRegistry
to loadClass
definitions 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 Boolean
resolveProperty
(String propertyName, Boolean defaultValue) protected <T> T
resolveProperty
(String propertyName, Class<T> targetType) Attempts to resolve the property with the givenname
from the SpringEnvironment
.protected <T> T
resolveProperty
(String propertyName, Class<T> targetType, T defaultValue) Attempts to resolve the property with the givenname
from the SpringEnvironment
.protected Double
resolveProperty
(String propertyName, Double defaultValue) protected Float
resolveProperty
(String propertyName, Float defaultValue) protected Integer
resolveProperty
(String propertyName, Integer defaultValue) protected Long
resolveProperty
(String propertyName, Long defaultValue) protected String
resolveProperty
(String propertyName, String defaultValue) protected <T> Class<T>
safeResolveType
(AbstractAnnotationConfigSupport.TypeResolver<T> typeResolver) Safely resolves atype
returned by the givenAbstractAnnotationConfigSupport.TypeResolver
where thetype
resolution might result in aClassNotFoundException
orNoClassDefFoundError
.protected String
securityProperty
(String propertyNameSuffix) protected String
serviceProperty
(String propertyNameSuffix) void
setBeanClassLoader
(ClassLoader beanClassLoader) void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) void
setEnvironment
(org.springframework.core.env.Environment environment) Sets a reference to the SpringEnvironment
.protected String
sslProperty
(String propertyNameSuffix) protected String
statsProperty
(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 ofAbstractAnnotationConfigSupport
initialized with the given, non-requiredBeanFactory
.- Parameters:
beanFactory
- reference to the SpringBeanFactory
.- See Also:
-
BeanFactory
newEvaluationContext(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:
-
BeanFactory
EvaluationContext
getBeanFactory()
-
newLogger
@NonNull protected org.slf4j.Logger newLogger()Constructs a new instance ofLogger
to 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-data
for a particularClass
is annotated with the declaredgetAnnotationTypeName()
.- Parameters:
importingClassMetadata
-type meta-data
for a particularClass
.- Returns:
- a boolean indicating whether the particular
Class
is 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-data
for a particularClass
is annotated with the givenAnnotation
defined byname
.- Parameters:
importingClassMetadata
-type meta-data
for a particularClass
.annotationName
-name
of theAnnotation
of interests.- Returns:
- a boolean indicating whether the particular
Class
is annotated with the givenAnnotation
defined byname
. - See Also:
-
AnnotationMetadata
-
getAnnotationAttributes
@NonNull protected org.springframework.core.annotation.AnnotationAttributes getAnnotationAttributes(@NonNull Annotation annotation) Returns theAnnotationAttributes
for the givenAnnotation
.- Parameters:
annotation
-Annotation
to get theAnnotationAttributes
for.- Returns:
- the
AnnotationAttributes
for the givenAnnotation
. - See Also:
-
AnnotationAttributes
Annotation
-
getAnnotationAttributes
@NonNull protected org.springframework.core.annotation.AnnotationAttributes getAnnotationAttributes(@NonNull org.springframework.core.type.AnnotationMetadata importingClassMetadata) ReturnsAnnotationAttributes
for the declaredgetAnnotationTypeName()
.- Parameters:
importingClassMetadata
-type meta-data
for a particularClass
.- Returns:
AnnotationAttributes
for the declaredgetAnnotationTypeName()
.- See Also:
-
AnnotationAttributes
AnnotationMetadata
getAnnotationAttributes(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-data
for a particularClass
.annotationName
-name
of theAnnotation
of interests.- Returns:
AnnotationAttributes
for the givennamed
Annotation
.- See Also:
-
AnnotationAttributes
AnnotationMetadata
-
getAnnotationType
Returns the cache applicationAnnotation
type pertaining to this configuration.- Returns:
- the cache application
Annotation
type used by this application.
-
getAnnotationTypeName
Returns the fully-qualifiedclass name
of the cache applicationAnnotation
type.- Returns:
- the fully-qualified
class name
of the cache applicationAnnotation
type. - See Also:
-
getAnnotationTypeSimpleName
Returns the simpleclass name
of the cache applicationAnnotation
type.- Returns:
- the simple
class name
of the cache applicationAnnotation
type. - See Also:
-
isNotInfrastructureBean
Null-safe method used to determine whether the givenbean
is a Spring container provided infrastructure bean.- Parameters:
bean
-Object
to evaluate.- Returns:
- true iff the
bean
is 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 givenBeanDefinition
is a Spring container provided infrastructure bean.- Parameters:
beanDefinition
-BeanDefinition
to evaluate.- Returns:
- true iff the bean defined by the given
BeanDefinition
is 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 givenBeanDefinition
is a Spring container infrastructure bean based on the bean's class name.- Parameters:
beanDefinition
-BeanDefinition
of the bean to evaluate.- Returns:
- true iff the bean defined in the given
BeanDefinition
is not a Spring container infrastructure bean. Returns false if the bean class name cannot be resolved. - See Also:
-
BeanDefinition
resolveBeanClassName(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 givenBeanDefinition
is a Spring container infrastructure bean based on the bean's role.- Parameters:
beanDefinition
-BeanDefinition
of the bean to evaluate.- Returns:
- true iff the bean defined in the given
BeanDefinition
is not a Spring container infrastructure bean. - See Also:
-
BeanDefinition
-
isUserLevelMethod
Determines whether the givenMethod
was declared and defined by the user. AMethod
is considered a user-levelMethod
if theMethod
is not anObject
class method, is aBridge Method
or is notMethod.isSynthetic()
nor a Groovy method. -
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
getBeanClassLoader
Returns a reference to theClassLoader
use by the SpringBeanFactory
to load classes for bean definitions.- Returns:
- the
ClassLoader
used by the SpringBeanFactory
to load classes for bean definitions. - See Also:
-
resolveBeanClassLoader
- Returns:
- the configured
ClassLoader
or theThread Context ClassLoader
. - See Also:
-
setBeanFactory
public void setBeanFactory(@Nullable org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
getBeanFactory
@NonNull protected org.springframework.beans.factory.BeanFactory getBeanFactory()Returns a reference to the SpringBeanFactory
in the current application context.- Returns:
- a reference to the Spring
BeanFactory
. - Throws:
IllegalStateException
- if the SpringBeanFactory
was 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:
setEnvironment
in 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 theEvaluationContext
used to evaluate SpEL expressions.- Returns:
- a reference to the
EvaluationContext
used to evaluate SpEL expressions. - See Also:
-
EvaluationContext
-
getLogger
@NonNull protected org.slf4j.Logger getLogger()Returns a reference to theLogger
used by this class to logmessages
.- Returns:
- a reference to the
Logger
used by this class to logmessages
. - See Also:
-
Log
-
logDebug
-
logDebug
- Parameters:
message
-Supplier
containing themessage
and arguments to log.- See Also:
-
Log.isDebugEnabled()
Log.debug(Object)
getLogger()
-
logInfo
-
logInfo
- Parameters:
message
-Supplier
containing themessage
and arguments to log.- See Also:
-
Log.isInfoEnabled()
Log.info(Object)
getLogger()
-
logWarning
-
logWarning
- Parameters:
message
-Supplier
containing themessage
and arguments to log.- See Also:
-
Log.isWarnEnabled()
Log.warn(Object)
getLogger()
-
logError
-
logError
- Parameters:
message
-Supplier
containing themessage
and 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
-AbstractBeanDefinition
to register.- Returns:
- the given
AbstractBeanDefinition
. - See Also:
-
BeanFactory
AbstractBeanDefinition
BeanDefinitionRegistry
BeanDefinitionReaderUtils.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 theAbstractBeanDefinition
with the givenBeanDefinitionRegistry
using a generatedbean name
.- Parameters:
beanDefinition
-AbstractBeanDefinition
to register.registry
-BeanDefinitionRegistry
used to register theAbstractBeanDefinition
.- Returns:
- the given
AbstractBeanDefinition
. - See Also:
-
AbstractBeanDefinition
BeanDefinitionRegistry
BeanDefinitionReaderUtils.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 name
consists of theproperty name
concatenated with thepropertyNameSuffix
.- Parameters:
propertyNameSuffix
-String
containing 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 byname
from the SpringEnvironment
as an instance of the specifiedtype
.- Type Parameters:
T
-Class
type of thepropertyName property's
assigned value.- Parameters:
propertyName
-String
containing the name of the required property to resolve.type
-Class
type of the property's assigned value.- Returns:
- the assigned value of the
named
property. - Throws:
IllegalArgumentException
- if the property has not been assigned a value. ForString
values, this also means the value cannot beempty
. For non-String
values, 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 type
of the resolvedAnnotation
.- Parameters:
annotatedElement
-AnnotatedElement
from which to resolve theAnnotation
.annotationType
-type
of theAnnotation
to 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 thetype
of the bean defined by the givenBeanDefinition
.- Parameters:
beanDefinition
-BeanDefinition
defining the bean from which thetype
is resolved.registry
-BeanDefinitionRegistry
used to resolve theClassLoader
used to resolve the bean'stype
.- Returns:
- an
Optional
Class
specifying the resolved type of the bean. - See Also:
-
BeanDefinition
BeanDefinitionRegistry
resolveBeanClassLoader(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 thetype
of the bean defined by the givenBeanDefinition
.- Parameters:
beanDefinition
-BeanDefinition
defining the bean from which thetype
is resolved.beanFactory
-ConfigurableBeanFactory
used to resolve theClassLoader
used to resolve the bean'stype
.- Returns:
- an
Optional
Class
specifying the resolved type of the bean. - See Also:
-
BeanDefinition
ConfigurableBeanFactory
resolveBeanClassLoader(ConfigurableBeanFactory)
resolveBeanClass(BeanDefinition, ClassLoader)
-
resolveBeanClass
protected Optional<Class<?>> resolveBeanClass(@Nullable org.springframework.beans.factory.config.BeanDefinition beanDefinition, @Nullable ClassLoader classLoader) Resolves thetype
of the bean defined by the givenBeanDefinition
.- Parameters:
beanDefinition
-BeanDefinition
defining the bean from which thetype
is resolved.classLoader
-ClassLoader
used to resolve the bean'stype
.- Returns:
- an
Optional
resolvedtype
of the bean. - See Also:
-
ClassLoader
BeanDefinition
AbstractBeanDefinition.resolveBeanClass(ClassLoader)
ClassUtils.forName(String, ClassLoader)
resolveBeanClassName(BeanDefinition)
-
resolveBeanClassLoader
@NonNull protected ClassLoader resolveBeanClassLoader(@Nullable org.springframework.beans.factory.support.BeanDefinitionRegistry registry) Attempts to resolve theClassLoader
used by theBeanDefinitionRegistry
to loadClass
definitions of the beans defined in the registry.- Parameters:
registry
-BeanDefinitionRegistry
from which to resolve theClassLoader
.- Returns:
- the resolved
ClassLoader
from theBeanDefinitionRegistry
or thecurrent Thread's
context ClassLoader
. - See Also:
-
ConfigurableBeanFactory.getBeanClassLoader()
BeanDefinitionRegistry
Thread.getContextClassLoader()
Thread.currentThread()
-
resolveBeanClassLoader
@NonNull protected ClassLoader resolveBeanClassLoader(@Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) Attempts to resolve theClassLoader
used by theConfigurableBeanFactory
to loadClass
definitions of the beans created by the factory.- Parameters:
beanFactory
-ConfigurableBeanFactory
from which to resolve theClassLoader
.- Returns:
- the resolved
ClassLoader
from theConfigurableBeanFactory
or thecurrent Thread's
context ClassLoader
. - See Also:
-
ConfigurableBeanFactory.getBeanClassLoader()
ConfigurableBeanFactory
Thread.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 givenname
from the SpringEnvironment
. -
resolveProperty
Attempts to resolve the property with the givenname
from the SpringEnvironment
.- Type Parameters:
T
-Class
type of the property value.- Parameters:
propertyName
-name
of the property to resolve.targetType
-Class
type 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
name
or 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 atype
returned by the givenAbstractAnnotationConfigSupport.TypeResolver
where thetype
resolution might result in aClassNotFoundException
orNoClassDefFoundError
.- Type Parameters:
T
-Class
of the type being resolved.- Parameters:
typeResolver
-AbstractAnnotationConfigSupport.TypeResolver
used to resolve a specifictype
.- Returns:
- the resolved
type
or null if thetype
returned by theAbstractAnnotationConfigSupport.TypeResolver
could not be resolved. - See Also:
-