Package com.isomorphic.datasource
Interface DynamicDSGenerator
- All Known Implementing Classes:
AuditDSGenerator
public interface DynamicDSGenerator
DynamicDSGenerator
s can be registered with the SmartClient Server framework via the DataSource.addDynamicDSGenerator(DynamicDSGenerator)
method. The framework will call the getDataSource
method of registered DynamicDSGenerators
whenever it needs to obtain a DataSource, giving user code a means of generating DataSource definitions at runtime, rather than (or as well as) providing them as .ds.xml
files in the filesystem.-
Method Summary
Modifier and TypeMethodDescriptiongetDataSource
(String id, DSRequest dsRequest) Returns an instance ofDataSource
.
-
Method Details
-
getDataSource
Returns an instance ofDataSource
. If you do not wish to provide an instance for the given ID, returnnull
and the system will go through its normal process for loading a DataSource. Please see the docs forDataSource.addDynamicDSGenerator(DynamicDSGenerator)
for an important warning about this. NOTE: Please scan the client-side documentation for "serverDataSourceImplementation" for a discussion of caching and thread-safety issues with server-side DataSources.- Parameters:
id
- The ID of the DataSource the framework is trying to obtaindsRequest
- TheDSRequest
for which the framework is trying to obtain a DataSource. This will be null if the DataSource is not needed in the context of a DSRequest- Returns:
- A DataSource instance
-