GigaSpaces XAP 10.0.1 API

org.openspaces.persistency.hibernate
Class AbstractHibernateSpaceDataSource

java.lang.Object
  extended by com.gigaspaces.datasource.SpaceDataSource
      extended by org.openspaces.persistency.ClusterInfoAwareSpaceDataSource
          extended by org.openspaces.persistency.patterns.ManagedEntriesSpaceDataSource
              extended by org.openspaces.persistency.hibernate.AbstractHibernateSpaceDataSource
All Implemented Interfaces:
ClusterInfoAware
Direct Known Subclasses:
DefaultHibernateSpaceDataSource, StatelessHibernateSpaceDataSource

public abstract class AbstractHibernateSpaceDataSource
extends ManagedEntriesSpaceDataSource

A base class for Hibernate based SpaceDataSource implementations.

Since:
9.5
Author:
eitany

Field Summary
protected static Log logger
           
 
Fields inherited from class org.openspaces.persistency.ClusterInfoAwareSpaceDataSource
augmentInitialLoadEntries, clusterInfo, initialLoadQueries, initialLoadQueryScanningBasePackages
 
Constructor Summary
AbstractHibernateSpaceDataSource(org.hibernate.SessionFactory sessionFactory, Set<String> managedEntries, int fetchSize, boolean performOrderById, String[] initialLoadEntries, int initialLoadThreadPoolSize, int initialLoadChunkSize, boolean useScrollableResultSet, String[] initialLoadQueryScanningBasePackages, boolean augmentInitialLoadEntries, ClusterInfo clusterInfo)
           
 
Method Summary
protected  DataIterator createInitialLoadIterator(DataIterator[] iterators)
          A helper method that creates the initial load iterator using the ConcurrentMultiDataIterator with the provided #setInitialLoadThreadPoolSize(int) thread pool size.
protected  int getFetchSize()
           
protected  int getInitialLoadChunkSize()
           
protected  Set<String> getInitialLoadEntries()
           
 Iterable<String> getManagedEntries()
           
protected  org.hibernate.SessionFactory getSessionFactory()
           
 DataIterator<SpaceTypeDescriptor> initialMetadataLoad()
          This method is invoked on space initialization (before SpaceDataSource.initialDataLoad() is invoked) and is used for introducing data types kept in the data source to the space.
protected  boolean isManagedEntry(String entityName)
          Returns if the given entity name is part of the getManagedEntries() list.
protected  boolean isPerformOrderById()
           
protected  boolean isUseScrollableResultSet()
           
protected  void obtainInitialLoadQueries()
          This method scans the classpath using Spring's ClassPathScanningCandidateComponentProvider.
 boolean supportsInheritance()
          Determines whether this implementation supports types inheritance.
 
Methods inherited from class org.openspaces.persistency.ClusterInfoAwareSpaceDataSource
createInitialLoadQuery, getInitialLoadQueries, setClusterInfo, setInitialLoadQueryScanningBasePackages
 
Methods inherited from class com.gigaspaces.datasource.SpaceDataSource
getById, getDataIterator, getDataIteratorByIds, initialDataLoad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Log logger
Constructor Detail

AbstractHibernateSpaceDataSource

public AbstractHibernateSpaceDataSource(org.hibernate.SessionFactory sessionFactory,
                                        Set<String> managedEntries,
                                        int fetchSize,
                                        boolean performOrderById,
                                        String[] initialLoadEntries,
                                        int initialLoadThreadPoolSize,
                                        int initialLoadChunkSize,
                                        boolean useScrollableResultSet,
                                        String[] initialLoadQueryScanningBasePackages,
                                        boolean augmentInitialLoadEntries,
                                        ClusterInfo clusterInfo)
Method Detail

getInitialLoadEntries

protected Set<String> getInitialLoadEntries()

getInitialLoadChunkSize

protected int getInitialLoadChunkSize()

isUseScrollableResultSet

protected boolean isUseScrollableResultSet()

getSessionFactory

protected org.hibernate.SessionFactory getSessionFactory()

getFetchSize

protected int getFetchSize()

isPerformOrderById

protected boolean isPerformOrderById()

createInitialLoadIterator

protected DataIterator createInitialLoadIterator(DataIterator[] iterators)
A helper method that creates the initial load iterator using the ConcurrentMultiDataIterator with the provided #setInitialLoadThreadPoolSize(int) thread pool size.


isManagedEntry

protected boolean isManagedEntry(String entityName)
Returns if the given entity name is part of the getManagedEntries() list.


supportsInheritance

public boolean supportsInheritance()
Description copied from class: SpaceDataSource
Determines whether this implementation supports types inheritance.

If types inheritance is not supported - SpaceDataSource.getDataIterator(DataSourceQuery) will be invoked for each derived type of the query's data type. Otherwise a single SpaceDataSource.getDataIterator(DataSourceQuery) invocation will be made for the query.

Overrides:
supportsInheritance in class SpaceDataSource
Returns:
true if this SpaceDataSource implementation supports types inheritance, otherwise false.

getManagedEntries

public Iterable<String> getManagedEntries()
Specified by:
getManagedEntries in class ManagedEntriesSpaceDataSource

initialMetadataLoad

public DataIterator<SpaceTypeDescriptor> initialMetadataLoad()
Description copied from class: SpaceDataSource
This method is invoked on space initialization (before SpaceDataSource.initialDataLoad() is invoked) and is used for introducing data types kept in the data source to the space.

Please note that derived types should be returned after their super types from the iterator.

It is possible to create a SpaceTypeDescriptor using SpaceTypeDescriptorBuilder.

Overrides:
initialMetadataLoad in class ClusterInfoAwareSpaceDataSource
Returns:
A DataIterator instance which contains all SpaceTypeDescriptor instances to be introduced to the Space upon its initialization - null is treated as an empty iterator.

obtainInitialLoadQueries

protected void obtainInitialLoadQueries()
Description copied from class: ClusterInfoAwareSpaceDataSource
This method scans the classpath using Spring's ClassPathScanningCandidateComponentProvider. This scanner uses the logic in the #isClassMatch method to retrieve names of classes that contain a method annotated with SpaceInitialLoadQuery. This collection of class names is then handled in such a way that each annotated method is validated, examined and eventually invoked to obtain the specific type's initial load query.

Overrides:
obtainInitialLoadQueries in class ClusterInfoAwareSpaceDataSource

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.