Revision 45461 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/DefaultDataManager.java
DefaultDataManager.java | ||
---|---|---|
112 | 112 |
import org.gvsig.tools.script.Script; |
113 | 113 |
import org.gvsig.tools.script.ScriptManager; |
114 | 114 |
import org.gvsig.tools.service.spi.Services; |
115 |
import org.gvsig.tools.util.Factory; |
|
115 | 116 |
import org.slf4j.Logger; |
116 | 117 |
import org.slf4j.LoggerFactory; |
117 | 118 |
|
... | ... | |
180 | 181 |
private final Set<Observer>storeObservers = new HashSet<>(); |
181 | 182 |
|
182 | 183 |
private long maxSizeForSmallFeatureSelection; |
184 |
|
|
185 |
private Factory largeMapFactory; |
|
186 |
private Factory largeSetFactory; |
|
183 | 187 |
|
184 | 188 |
public DefaultDataManager() { |
185 | 189 |
this.registers = new Registers(); |
186 | 190 |
this.defaultDataIndexProviders = new HashMap<>(); |
187 | 191 |
this.maxSizeForSmallFeatureSelection = DEFAULT_MAX_SIZE_FOR_SMALL_FEATURE_SELECTION; |
192 |
this.largeMapFactory = new Factory() { |
|
193 |
@Override |
|
194 |
public String getName() { |
|
195 |
return "HashMapFactory"; |
|
196 |
} |
|
197 |
|
|
198 |
@Override |
|
199 |
public Object create(Object... parameters) { |
|
200 |
return new HashMap(); |
|
201 |
} |
|
202 |
}; |
|
203 |
this.largeSetFactory = new Factory() { |
|
204 |
@Override |
|
205 |
public String getName() { |
|
206 |
return "HashSetFactory"; |
|
207 |
} |
|
208 |
|
|
209 |
@Override |
|
210 |
public Object create(Object... parameters) { |
|
211 |
return new HashSet(); |
|
212 |
} |
|
213 |
}; |
|
214 |
|
|
215 |
// TODO: Esto habria que llevarlo al plugin de h2 |
|
216 |
this.registerLargeMap(new Factory() { |
|
217 |
@Override |
|
218 |
public String getName() { |
|
219 |
return "MVStoreMapFactory"; |
|
220 |
} |
|
221 |
|
|
222 |
@Override |
|
223 |
public Object create(Object... parameters) { |
|
224 |
return new LargeMapImpl(); |
|
225 |
} |
|
226 |
}); |
|
227 |
this.registerLargeSet(new Factory() { |
|
228 |
@Override |
|
229 |
public String getName() { |
|
230 |
return "MVStoreSetFactory"; |
|
231 |
} |
|
232 |
|
|
233 |
@Override |
|
234 |
public Object create(Object... parameters) { |
|
235 |
return new LargeSetImpl(); |
|
236 |
} |
|
237 |
}); |
|
188 | 238 |
} |
189 | 239 |
|
190 | 240 |
@Override |
... | ... | |
1402 | 1452 |
return this.maxSizeForSmallFeatureSelection; |
1403 | 1453 |
} |
1404 | 1454 |
|
1455 |
public void registerLargeMap(Factory factory) { |
|
1456 |
this.largeMapFactory = factory; |
|
1457 |
} |
|
1458 |
|
|
1459 |
public void registerLargeSet(Factory factory) { |
|
1460 |
this.largeSetFactory = factory; |
|
1461 |
} |
|
1462 |
|
|
1405 | 1463 |
@Override |
1406 | 1464 |
public Map createLargeMap() { |
1407 |
return new LargeMapImpl();
|
|
1465 |
return (Map) this.largeMapFactory.create();
|
|
1408 | 1466 |
} |
1409 | 1467 |
|
1410 | 1468 |
@Override |
1411 | 1469 |
public Set createLargeSet() { |
1412 |
return new LargeSetImpl();
|
|
1470 |
return (Set) this.largeSetFactory.create();
|
|
1413 | 1471 |
} |
1414 | 1472 |
|
1415 | 1473 |
@Override |
Also available in: Unified diff