|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gigaspaces.serialization.pbs.commands.DispatcherObjectProxy
com.gigaspaces.serialization.pbs.commands.ConstructableDispatcherObjectProxy
com.gigaspaces.datasource.dotnet.DotNetDataSourceAdapter
public class DotNetDataSourceAdapter
DotNetDataSourceAdapter is a proxy to a custom .Net implementation of space external data source. Every method call by the space will be executed remotely in a custom .Net implementation of the ISqlDataSource interface which is correlated to the JavaSqlDataProvider
andBulkDataPersister
interface. <b>Configuration</b> To use theDotNetDataSourceAdapter
the space schema XML configuration file should include the following. <space-config> <persistent> <enabled>true</enabled> <StorageAdapterClass>com.gigaspaces.datasource.DataAdapter</StorageAdapterClass> </persistent> <external-data-source> <data-source-class>com.gigaspaces.datasource.dotnet.DotNetAdapter</data-source-class> <data-class>System.Object</data-class> <init-properties-file><properties file></init-properties-file> </external-data-source> </space-config> You need to configure <properties file> file, in it you can choose between the two options: 1) Use a .Net configuration file in order to configure the .Net SqlDataSource implementation in this case define the following and point it to your .Net config file: dotnet-config-file=<.Net config file> 2) Configure everything in the java properties file: dotnet-implementation-name=<.Net fully qualified Type name of the implementation of the ISqlDataSource interface> dotnet-assembly-file=<.Net assembly file path containing the ISqlDataSource implementation> dotnet-dependencies-files=<Additional .Net assemblies that needs to be loaded> Any additional implementation's custom properties can also be put into this file
Field Summary | |
---|---|
static String |
AssemblyFileProperty
|
static String |
ConfigFileProperty
|
static String |
DependenciesProperty
|
static String |
ImplementationNameProperty
|
static String |
IteratorBatchSizeProperty
|
Fields inherited from class com.gigaspaces.serialization.pbs.commands.DispatcherObjectProxy |
---|
autoDisposeOnGC, contextAppDomainId, handleInjected, isDisposed |
Fields inherited from interface com.gigaspaces.datasource.ManagedDataSource |
---|
DATA_CLASS_PROPS, NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER |
Constructor Summary | |
---|---|
DotNetDataSourceAdapter()
|
|
DotNetDataSourceAdapter(long dotnetEdsHandleId,
int contextAppDomainId,
Properties customProperties)
|
Method Summary | |
---|---|
void |
executeBulk(List<BulkItem> bulk)
Execute given bulk of operations. |
void |
init(Properties prop)
Initialize and configure the data source using given properties. |
DataIterator<IGSEntry> |
initialLoad()
Creates and returns an iterator over all the entries that should be loaded into space. |
DataIterator<IGSEntry> |
iterator(SQLQuery<IGSEntry> query)
Create an iterator over all objects that match the given |
void |
setConfigFile(String configFile)
Inject a .Net config file (Should be called prior to init, otherwise its effect is dismissed |
void |
setIteratorBatchSize(int size)
Inject an iterator batch size file |
void |
shutdown()
Close the data source and clean any used resources. |
Methods inherited from class com.gigaspaces.serialization.pbs.commands.ConstructableDispatcherObjectProxy |
---|
setAssemblyFile, setCustomProperties, setDependencies, setHandleId, setImplementationName |
Methods inherited from class com.gigaspaces.serialization.pbs.commands.DispatcherObjectProxy |
---|
getHandleId |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ConfigFileProperty
public static final String IteratorBatchSizeProperty
public static final String ImplementationNameProperty
public static final String AssemblyFileProperty
public static final String DependenciesProperty
Constructor Detail |
---|
public DotNetDataSourceAdapter(long dotnetEdsHandleId, int contextAppDomainId, Properties customProperties)
public DotNetDataSourceAdapter()
Method Detail |
---|
public void setConfigFile(String configFile)
configFile
- public void setIteratorBatchSize(int size)
size
- public DataIterator<IGSEntry> iterator(SQLQuery<IGSEntry> query) throws DataSourceException
Create an iterator over all objects that match the givenSQLQuery
. SQLQuery contains a string representation of SQL 'where' clause. The format matches thePreparedStatement
format(field1 = ? and field2 > ? and ....). The prepared values are accessible bySQLQuery
.getPreparedValues() method Example implementation with SQL PreparedStatement:PreparedStatement st = con.prepareStatement(query.getSelectAllQuery()); int index = 0; if(query.hasPreparedValues()) { for(Iterator iter = query.getPreparedValues().iterator();iter.hasNext()) { st.setObject(++index,iter.next()); } } ResultSet rs = st.executeQuery(); return new ResultSetIterator(rs);
iterator
in interface SQLDataProvider<IGSEntry>
DataIterator
or null if no data was found that match the given template
DataSourceException
ResultSetIterator
public void init(Properties prop) throws DataSourceException
init
in interface ManagedDataSource<IGSEntry>
prop
- - contains user defined param and Partition data
DataSourceException
public DataIterator<IGSEntry> initialLoad() throws DataSourceException
Creates and returns an iterator over all the entries that should be loaded into space.
initialLoad
in interface ManagedDataSource<IGSEntry>
DataIterator
or null if no data should be loaded into space
DataSourceException
public void shutdown() throws DataSourceException
shutdown
in interface ManagedDataSource<IGSEntry>
DataSourceException
public void executeBulk(List<BulkItem> bulk) throws DataSourceException
BulkItem
contains one of the following operation -
executeBulk
in interface BulkDataPersister
bulk
- list of data object and the operation to apply on that object
DataSourceException
- when the data store fails to persist the given list of objects
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |