Class GemfireRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID>
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
org.springframework.data.gemfire.repository.support.GemfireRepositoryFactoryBean<T,S,ID>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.FactoryBean<T>
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationEventPublisherAware
,org.springframework.data.repository.core.support.RepositoryFactoryInformation<S,
ID>
public class GemfireRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID>
extends org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
implements org.springframework.context.ApplicationContextAware
Spring
FactoryBean
adapter for GemfireRepositoryFactory
.- See Also:
-
GemFireCache
Region
FactoryBean
ApplicationContext
ApplicationContextAware
GemfireMappingContext
GemfirePersistentEntity
GemfirePersistentProperty
GemfireRepositoryQuery
QueryPostProcessor
MappingContext
Repository
RepositoryDefinition
QueryCreationListener
RepositoryFactoryBeanSupport
RepositoryFactorySupport
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
ConstructorDescriptionGemfireRepositoryFactoryBean
(Class<? extends T> repositoryInterface) Constructs a new instance ofGemfireRepositoryFactoryBean
initialized with the givenRepository
interface
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Initializes theGemfireRepositoryFactoryBean
by configuringRegions
and resolving theGemfireMappingContext
.protected void
Configures a reference to aSet
of allRegions
defined, declared and registered in the SpringApplicationContext
as well as in the Apache GeodeGemFireCache
.protected org.springframework.data.repository.core.support.RepositoryFactorySupport
Creates a new instance ofGemfireRepositoryFactory
used to create an Apache GeodeRepository
.protected Optional<org.springframework.context.ApplicationContext>
Returns anOptional
reference to the configured SpringApplicationContext
.protected Optional<org.apache.geode.cache.GemFireCache>
getCache()
Returns anOptional
reference to the configured Apache GeodeGemFireCache
.protected org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,
GemfirePersistentProperty> Returns a reference to the Spring DataMappingContext
used to perform application domain object type to data store mappings.protected Iterable<org.apache.geode.cache.Region<?,
?>> protected org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,
GemfirePersistentProperty> Attempts to resolve theMappingContext
used to mapentities
to Apache Geode.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) Sets a reference to the SpringApplicationContext
.void
setCache
(org.apache.geode.cache.GemFireCache cache) Set a reference to the Apache GeodeGemFireCache
.void
setGemfireMappingContext
(org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>, GemfirePersistentProperty> mappingContext) Configures theMappingContext
used to perform application domain object type to data store mappings.Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport
addRepositoryFactoryCustomizer, createDefaultQueryMethodEvaluationContextProvider, getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryInformation, isSingleton, setApplicationEventPublisher, setBeanClassLoader, setBeanFactory, setCustomImplementation, setEvaluationContextProvider, setLazyInit, setMappingContext, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments
-
Constructor Details
-
GemfireRepositoryFactoryBean
Constructs a new instance ofGemfireRepositoryFactoryBean
initialized with the givenRepository
interface
.- Parameters:
repositoryInterface
-interface
specifying the application data access operations contract; must not be null.- Throws:
IllegalArgumentException
- if theRepository
interface
is null.- See Also:
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(@Nullable org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException Sets a reference to the SpringApplicationContext
.- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Parameters:
applicationContext
- reference to the SpringApplicationContext
.- Throws:
org.springframework.beans.BeansException
- See Also:
-
ApplicationContextAware.setApplicationContext(ApplicationContext)
ApplicationContext
-
getApplicationContext
Returns anOptional
reference to the configured SpringApplicationContext
. -
setCache
public void setCache(@Nullable org.apache.geode.cache.GemFireCache cache) Set a reference to the Apache GeodeGemFireCache
.- Parameters:
cache
- reference to the Apache GeodeGemFireCache
.- See Also:
-
GemFireCache
-
getCache
Returns anOptional
reference to the configured Apache GeodeGemFireCache
.- Returns:
- an
Optional
reference to the configured Apache GeodeGemFireCache
. - See Also:
-
GemFireCache
-
setGemfireMappingContext
@Autowired(required=false) public void setGemfireMappingContext(@Nullable org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>, GemfirePersistentProperty> mappingContext) Configures theMappingContext
used to perform application domain object type to data store mappings.- Parameters:
mappingContext
-MappingContext
to configure.- See Also:
-
GemfireMappingContext
MappingContext
-
getGemfireMappingContext
@Nullable protected org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,GemfirePersistentProperty> getGemfireMappingContext()Returns a reference to the Spring DataMappingContext
used to perform application domain object type to data store mappings.- Returns:
- a reference to the
MappingContext
. - See Also:
-
GemfireMappingContext
MappingContext
setGemfireMappingContext(MappingContext)
-
getRegions
- Returns:
- a reference to all
Regions
defined in the SpringApplicationContext
. - See Also:
-
Region
Iterable
-
afterPropertiesSet
public void afterPropertiesSet()Initializes theGemfireRepositoryFactoryBean
by configuringRegions
and resolving theGemfireMappingContext
.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,
ID>, S, ID> - See Also:
-
configureRegions()
resolveGemfireMappingContext()
InitializingBean.afterPropertiesSet()
-
configureRegions
protected void configureRegions()Configures a reference to aSet
of allRegions
defined, declared and registered in the SpringApplicationContext
as well as in the Apache GeodeGemFireCache
. -
createRepositoryFactory
protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory()Creates a new instance ofGemfireRepositoryFactory
used to create an Apache GeodeRepository
. -
resolveGemfireMappingContext
protected org.springframework.data.mapping.context.MappingContext<? extends GemfirePersistentEntity<?>,GemfirePersistentProperty> resolveGemfireMappingContext()Attempts to resolve theMappingContext
used to mapentities
to Apache Geode.- Returns:
- a reference to the resolved
MappingContext
. - Throws:
IllegalStateException
- if theMappingContext
cannot be resolved.- See Also:
-
GemfireMappingContext
MappingContext
-