Factory used to construct a DataStore from a set of parameters.
The following example shows how a user might connect to a PostGIS database, and maintain the resulting DataStore in a Registry:
HashMap params = new HashMap(); params.put("namespace", "leeds"); params.put("dbtype", "postgis"); params.put("host","feathers.leeds.ac.uk"); params.put("port", "5432"); params.put("database","postgis_test"); params.put("user","postgis_ro"); params.put("passwd","postgis_ro"); DefaultRegistry registry = new DefaultRegistry(); registry.addDataStore("leeds", params); DataStore postgis = registry.getDataStore( "leeds" ); SimpleFeatureSource = postgis.getFeatureSource( "table" );
Implementation Notes
An instance of this interface should exist for all data stores which want to take advantage of the dynamic plug-in system. In addition to implementing this factory interface each DataStore implementation should have a services file:
META-INF/services/org.geotools.data.DataStoreFactorySpi
The file should contain a single line which gives the full name of the implementing class.
example:
e.g. org.geotools.data.mytype.MyTypeDataSourceFacotry
The factories are never called directly by client code, instead the DataStoreFinder class is used.
@author Jody Garnett, Refractions Research
@source $URL$