Class GemfireRepositoryFactoryBean<T extends 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:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,FactoryBean<T>
,InitializingBean
,ApplicationContextAware
,ApplicationEventPublisherAware
,RepositoryFactoryInformation<S,
ID>
public class GemfireRepositoryFactoryBean<T extends Repository<S,ID>,S,ID>
extends RepositoryFactoryBeanSupport<T,S,ID>
implements ApplicationContextAware
Spring
FactoryBean
adapter for GemfireRepositoryFactory
.- Author:
- Oliver Gierke, John Blum
- 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 RepositoryFactorySupport
Creates a new instance ofGemfireRepositoryFactory
used to create an Apache GeodeRepository
.protected Optional<ApplicationContext>
Returns anOptional
reference to the configured SpringApplicationContext
.protected Optional<GemFireCache>
getCache()
Returns anOptional
reference to the configured Apache GeodeGemFireCache
.protected MappingContext<? extends GemfirePersistentEntity<?>,
GemfirePersistentProperty> Returns a reference to the Spring DataMappingContext
used to perform application domain object type to data store mappings.protected MappingContext<? extends GemfirePersistentEntity<?>,
GemfirePersistentProperty> Attempts to resolve theMappingContext
used to mapentities
to Apache Geode.void
setApplicationContext
(ApplicationContext applicationContext) Sets a reference to the SpringApplicationContext
.void
setCache
(GemFireCache cache) Set a reference to the Apache GeodeGemFireCache
.void
setGemfireMappingContext
(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 ApplicationContext applicationContext) throws BeansException Sets a reference to the SpringApplicationContext
.- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Parameters:
applicationContext
- reference to the SpringApplicationContext
.- Throws:
BeansException
- See Also:
-
getApplicationContext
Returns anOptional
reference to the configured SpringApplicationContext
.- Returns:
- an
Optional
reference to the configured SpringApplicationContext
. - See Also:
-
setCache
Set a reference to the Apache GeodeGemFireCache
.- Parameters:
cache
- reference to the Apache GeodeGemFireCache
.- See Also:
-
getCache
Returns anOptional
reference to the configured Apache GeodeGemFireCache
.- Returns:
- an
Optional
reference to the configured Apache GeodeGemFireCache
. - See Also:
-
setGemfireMappingContext
@Autowired(required=false) public void setGemfireMappingContext(@Nullable 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:
-
getGemfireMappingContext
@Nullable protected 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:
-
getRegions
- Returns:
- a reference to all
Regions
defined in the SpringApplicationContext
. - See Also:
-
afterPropertiesSet
public void afterPropertiesSet()Initializes theGemfireRepositoryFactoryBean
by configuringRegions
and resolving theGemfireMappingContext
.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID> - See Also:
-
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
Creates a new instance ofGemfireRepositoryFactory
used to create an Apache GeodeRepository
.- Specified by:
createRepositoryFactory
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID> - See Also:
-
resolveGemfireMappingContext
protected 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:
-