Revision 23010 branches/v2_0_0_prep/libraries/libFMap_data/src/org/gvsig/fmap/data/DataManager.java
DataManager.java | ||
---|---|---|
9 | 9 |
import org.gvsig.fmap.data.operation.DataStoreOperationException; |
10 | 10 |
import org.gvsig.fmap.data.operation.DataStoreOperationNotSupportedException; |
11 | 11 |
|
12 |
import com.iver.utiles.XMLEntity; |
|
12 | 13 |
|
14 |
|
|
13 | 15 |
public class DataManager { |
14 | 16 |
private static ArrayList registers = new ArrayList(); |
15 | 17 |
|
... | ... | |
47 | 49 |
} |
48 | 50 |
registers.add(register); |
49 | 51 |
} |
52 |
|
|
53 |
public DataStoreParameters createDataStoreParameters(XMLEntity xmlEntity) |
|
54 |
throws InitializeException { |
|
55 |
DataStoreParameters params = this.createDataStoreParameters(xmlEntity |
|
56 |
.getStringProperty("dataStoreName")); |
|
57 |
|
|
58 |
params.loadFromXMLEntity(xmlEntity); |
|
59 |
return params; |
|
60 |
|
|
61 |
} |
|
62 |
|
|
50 | 63 |
/** |
51 | 64 |
* Levanta una instancia de los parametros solicitados |
52 | 65 |
* inicializa el nombre en la instancia |
... | ... | |
95 | 108 |
} |
96 | 109 |
} |
97 | 110 |
|
111 |
public DataStore createDataStore(XMLEntity xmlEntity) |
|
112 |
throws InitializeException { |
|
113 |
String name = xmlEntity.getStringProperty("datastorename"); |
|
98 | 114 |
|
115 |
RegisterInfo registerInfo = this.getRegisterByName(name); |
|
116 |
if (registerInfo == null) { |
|
117 |
throw new InitializeException("Not registered in manager", name); |
|
118 |
} |
|
119 |
|
|
120 |
try { |
|
121 |
DataStore dataStore = (DataStore) registerInfo.clazz.newInstance(); |
|
122 |
dataStore.init(xmlEntity); |
|
123 |
return dataStore; |
|
124 |
} catch (InstantiationException e) { |
|
125 |
throw new InitializeException(name, e); |
|
126 |
} catch (IllegalAccessException e) { |
|
127 |
throw new InitializeException(name, e); |
|
128 |
} |
|
129 |
} |
|
130 |
|
|
131 |
|
|
99 | 132 |
/* Como conjunto de propiedades genericas a un tipo de DataStore |
100 | 133 |
* a las que se puede acceder sin tener que crear un DataStore/Driver. |
101 | 134 |
* |
Also available in: Unified diff