Class CoherenceRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,​ID>,​S,​ID extends Serializable>

  • Type Parameters:
    ID - the entity's identity type
    T - the repository type
    S - the entity type
    All Implemented Interfaces:
    Aware, BeanClassLoaderAware, BeanFactoryAware, FactoryBean<T>, InitializingBean, ApplicationEventPublisherAware, org.springframework.data.repository.core.support.RepositoryFactoryInformation<S,​ID>

    public class CoherenceRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,​ID>,​S,​ID extends Serializable>
    extends org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,​S,​ID>
    Factory responsible for creating Repository instances for a specific repository interface.
    Since:
    3.0
    Author:
    Ryan Lubke, Gunnar Hillert
    • Constructor Summary

      Constructors 
      Constructor Description
      CoherenceRepositoryFactoryBean​(Class<? extends T> repositoryInterface)
      Constructs a new CoherenceRepositoryFactoryBean for the provided repository interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()
      Ensure that coherence is not null.
      protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory()
      First checks for the presence of the CoherenceMap annotation to find the name of the Coherence NamedMap and Session.
      void setCoherence​(com.tangosol.net.Coherence coherence)
      Configures the Coherence instance to be used.
      • 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 Detail

      • CoherenceRepositoryFactoryBean

        public CoherenceRepositoryFactoryBean​(Class<? extends T> repositoryInterface)
        Constructs a new CoherenceRepositoryFactoryBean for the provided repository interface.
        Parameters:
        repositoryInterface - the repository interface
    • Method Detail

      • createRepositoryFactory

        protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory()
        First checks for the presence of the CoherenceMap annotation to find the name of the Coherence NamedMap and Session. If the annotation is not present, then if the repository class name itself follows the format of [Entity-Type]Repository (e.g., BookRepository), then the NamedMap will be looked up using the lower-case name of the entity type. Using the BookRepository example, the NamedMap would be resolved to book.
        Specified by:
        createRepositoryFactory in class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,​ID>,​S,​ID extends Serializable>
        Returns:
        Throws:
        IllegalStateException - if the NamedMap name cannot be resolved
      • setCoherence

        public void setCoherence​(com.tangosol.net.Coherence coherence)
        Configures the Coherence instance to be used.
        Parameters:
        coherence - the Coherence instance to set
      • afterPropertiesSet

        public void afterPropertiesSet()
        Ensure that coherence is not null.
        Specified by:
        afterPropertiesSet in interface InitializingBean
        Overrides:
        afterPropertiesSet in class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,​ID>,​S,​ID extends Serializable>
        See Also:
        RepositoryFactoryBeanSupport.afterPropertiesSet()