GigaSpaces XAP 10.0.1 API

org.openspaces.persistency
Class ClusterInfoAwareSpaceDataSource

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

public abstract class ClusterInfoAwareSpaceDataSource
extends SpaceDataSource
implements ClusterInfoAware

Created by yuvalm on 23/04/2014.

Since:
10.0

Field Summary
protected  boolean augmentInitialLoadEntries
           
protected  ClusterInfo clusterInfo
           
protected  Map<String,String> initialLoadQueries
           
protected  String[] initialLoadQueryScanningBasePackages
           
 
Constructor Summary
ClusterInfoAwareSpaceDataSource()
           
 
Method Summary
protected  String createInitialLoadQuery(SpaceTypeDescriptor typeDescriptor, String templateQuery)
           
 Map<String,String> getInitialLoadQueries()
           
 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  void obtainInitialLoadQueries()
          This method scans the classpath using Spring's ClassPathScanningCandidateComponentProvider.
 void setClusterInfo(ClusterInfo clusterInfo)
          Sets the cluster information.
 void setInitialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages)
           
 
Methods inherited from class com.gigaspaces.datasource.SpaceDataSource
getById, getDataIterator, getDataIteratorByIds, initialDataLoad, supportsInheritance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialLoadQueryScanningBasePackages

protected String[] initialLoadQueryScanningBasePackages

clusterInfo

protected ClusterInfo clusterInfo

initialLoadQueries

protected Map<String,String> initialLoadQueries

augmentInitialLoadEntries

protected boolean augmentInitialLoadEntries
Constructor Detail

ClusterInfoAwareSpaceDataSource

public ClusterInfoAwareSpaceDataSource()
Method Detail

setInitialLoadQueryScanningBasePackages

public void setInitialLoadQueryScanningBasePackages(String[] initialLoadQueryScanningBasePackages)

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 SpaceDataSource
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.

setClusterInfo

public void setClusterInfo(ClusterInfo clusterInfo)
Description copied from interface: ClusterInfoAware
Sets the cluster information.

Note, the cluster information is obtained externally from the application context which means that this feature need to be supported by specific containers (and is not supported by plain Spring application context). This means that beans that implement ClusterInfoAware should take into account the fact that the cluster info provided might be null.

Specified by:
setClusterInfo in interface ClusterInfoAware
Parameters:
clusterInfo - The cluster information to be injected

getInitialLoadQueries

public Map<String,String> getInitialLoadQueries()

obtainInitialLoadQueries

protected void obtainInitialLoadQueries()
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.


createInitialLoadQuery

protected String createInitialLoadQuery(SpaceTypeDescriptor typeDescriptor,
                                        String templateQuery)

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.