Revision 25785 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java
DefaultFeatureStore.java | ||
---|---|---|
4 | 4 |
import java.util.Collections; |
5 | 5 |
import java.util.Iterator; |
6 | 6 |
import java.util.List; |
7 |
import java.util.Set; |
|
7 | 8 |
|
8 | 9 |
import org.gvsig.fmap.dal.DALLocator; |
9 | 10 |
import org.gvsig.fmap.dal.DataManager; |
10 | 11 |
import org.gvsig.fmap.dal.DataQuery; |
11 | 12 |
import org.gvsig.fmap.dal.DataServerExplorer; |
12 | 13 |
import org.gvsig.fmap.dal.DataSet; |
14 |
import org.gvsig.fmap.dal.DataStore; |
|
13 | 15 |
import org.gvsig.fmap.dal.DataStoreNotification; |
14 | 16 |
import org.gvsig.fmap.dal.DataStoreParameters; |
15 | 17 |
import org.gvsig.fmap.dal.exception.CloseException; |
... | ... | |
66 | 68 |
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices; |
67 | 69 |
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices; |
68 | 70 |
import org.gvsig.fmap.dal.impl.DefaultDataManager; |
71 |
import org.gvsig.fmap.dal.resource.Resource; |
|
69 | 72 |
import org.gvsig.fmap.geom.primitive.Envelope; |
70 | 73 |
import org.gvsig.tools.ToolsLocator; |
74 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
75 |
import org.gvsig.tools.dynobject.DynClass; |
|
76 |
import org.gvsig.tools.dynobject.DynObject; |
|
77 |
import org.gvsig.tools.dynobject.DynObjectManager; |
|
78 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
|
79 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
|
71 | 80 |
import org.gvsig.tools.exception.NotYetImplemented; |
72 | 81 |
import org.gvsig.tools.observer.Observable; |
73 | 82 |
import org.gvsig.tools.observer.Observer; |
74 | 83 |
import org.gvsig.tools.observer.impl.DelegateWeakReferencingObservable; |
75 |
import org.gvsig.tools.operations.OperationContext; |
|
76 |
import org.gvsig.tools.operations.OperationException; |
|
77 |
import org.gvsig.tools.operations.OperationNotSupportedException; |
|
78 | 84 |
import org.gvsig.tools.persistence.AbstractPersistenceManager; |
79 | 85 |
import org.gvsig.tools.persistence.PersistenceException; |
80 | 86 |
import org.gvsig.tools.persistence.PersistenceValueNotFoundException; |
... | ... | |
119 | 125 |
|
120 | 126 |
private DefaultFeatureStoreTransforms transforms; |
121 | 127 |
|
128 |
private DelegatedDynObject dynObject; |
|
129 |
|
|
122 | 130 |
/* |
123 | 131 |
* TODO: |
124 | 132 |
* |
... | ... | |
141 | 149 |
private void initialize(DefaultDataManager manager, |
142 | 150 |
DataStoreParameters parameters, FeatureStoreProvider provider) |
143 | 151 |
throws InitializeException { |
152 |
|
|
153 |
DynObjectManager dynManager = ToolsLocator.getDynObjectManager(); |
|
154 |
|
|
155 |
this.dynObject = (DelegatedDynObject) dynManager |
|
156 |
.createDynObject(dynManager |
|
157 |
.get(DataStore.DYNCLASS_NAME)); |
|
144 | 158 |
this.dataManager = manager; |
145 | 159 |
this.provider = provider; |
146 | 160 |
this.parameters = parameters; |
... | ... | |
416 | 430 |
notification, type)); |
417 | 431 |
} |
418 | 432 |
|
433 |
/* |
|
434 |
* (non-Javadoc) |
|
435 |
* |
|
436 |
* @see |
|
437 |
* org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices#notifyChange |
|
438 |
* (java.lang.String, org.gvsig.fmap.dal.resource.Resource) |
|
439 |
*/ |
|
440 |
public void notifyChange(String notification, Resource resource) { |
|
441 |
// TODO Auto-generated method stub |
|
419 | 442 |
|
443 |
} |
|
444 |
|
|
445 |
|
|
420 | 446 |
// |
421 | 447 |
// ==================================================================== |
422 | 448 |
// Gestion de bloqueos |
... | ... | |
493 | 519 |
this.notifyChange(FeatureStoreNotification.LOCKS_CHANGE); |
494 | 520 |
} |
495 | 521 |
|
496 |
} |
|
497 |
}
|
|
522 |
} else if (observable instanceof FeatureStoreProvider) {
|
|
523 |
if (observable == this.provider) {
|
|
498 | 524 |
|
525 |
} |
|
499 | 526 |
|
500 |
// |
|
501 |
// ==================================================================== |
|
502 |
// Gestion de operaciones |
|
503 |
// Interface ExtendedOperations |
|
504 |
// |
|
505 |
public Object invokeOperation(int code, OperationContext context) |
|
506 |
throws OperationException, OperationNotSupportedException { |
|
507 |
return this.dataManager.getOperationManager().invokeOperation(this, code, context); |
|
527 |
} |
|
508 | 528 |
} |
509 | 529 |
|
510 |
public Object invokeOperation(String name, OperationContext context) |
|
511 |
throws OperationException, OperationNotSupportedException { |
|
512 |
return this.dataManager.getOperationManager().invokeOperation(this, name, context); |
|
513 |
} |
|
514 |
|
|
515 |
public boolean hasOperation(int code) { |
|
516 |
return this.dataManager.getOperationManager().hasOperation(this, code); |
|
517 |
} |
|
518 |
|
|
519 |
public boolean hasOperation(String name) { |
|
520 |
return this.dataManager.getOperationManager().hasOperation(this, name); |
|
521 |
} |
|
522 |
|
|
523 |
public Object getOperation(int code) throws OperationException { |
|
524 |
return this.dataManager.getOperationManager().getOperation(this, code); |
|
525 |
} |
|
526 |
|
|
527 |
public Object getOperation(String name) throws OperationException { |
|
528 |
return this.dataManager.getOperationManager().getOperation(this, name); |
|
529 |
} |
|
530 |
|
|
531 | 530 |
// |
532 | 531 |
// ==================================================================== |
533 | 532 |
// Edicion |
... | ... | |
1236 | 1235 |
return new FeatureQuery(); |
1237 | 1236 |
} |
1238 | 1237 |
|
1238 |
// |
|
1239 |
// ==================================================================== |
|
1240 |
// UndoRedo related methods |
|
1241 |
// |
|
1242 |
|
|
1239 | 1243 |
public boolean canRedo() { |
1240 | 1244 |
return commands.canRedo(); |
1241 | 1245 |
} |
... | ... | |
1251 | 1255 |
public void undo(int num) throws UndoException { |
1252 | 1256 |
commands.undo(num); |
1253 | 1257 |
} |
1258 |
|
|
1259 |
// |
|
1260 |
// ==================================================================== |
|
1261 |
// Metadata related methods |
|
1262 |
// |
|
1263 |
|
|
1264 |
public Object getMetadataID() { |
|
1265 |
return "FeatureStore." + this.provider.getMetadataID(); |
|
1266 |
} |
|
1267 |
|
|
1268 |
public void delegate(DynObject dynObject) { |
|
1269 |
this.dynObject.delegate(dynObject); |
|
1270 |
} |
|
1271 |
|
|
1272 |
public DynClass getDynClass() { |
|
1273 |
return this.dynObject.getDynClass(); |
|
1274 |
} |
|
1275 |
|
|
1276 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
|
1277 |
return this.dynObject.getDynValue(name); |
|
1278 |
} |
|
1279 |
|
|
1280 |
public boolean hasDynValue(String name) { |
|
1281 |
return this.dynObject.hasDynValue(name); |
|
1282 |
} |
|
1283 |
|
|
1284 |
public void implement(DynClass dynClass) { |
|
1285 |
this.dynObject.implement(dynClass); |
|
1286 |
} |
|
1287 |
|
|
1288 |
public Object invokeDynMethod(String name, DynObject context) |
|
1289 |
throws DynMethodException { |
|
1290 |
return this.dynObject.invokeDynMethod(this, name, context); |
|
1291 |
} |
|
1292 |
|
|
1293 |
public Object invokeDynMethod(int code, DynObject context) |
|
1294 |
throws DynMethodException { |
|
1295 |
return this.dynObject.invokeDynMethod(this, code, context); |
|
1296 |
} |
|
1297 |
|
|
1298 |
public void setDynValue(String name, Object value) |
|
1299 |
throws DynFieldNotFoundException { |
|
1300 |
this.setDynValue(name, value); |
|
1301 |
|
|
1302 |
} |
|
1303 |
|
|
1304 |
/* |
|
1305 |
* (non-Javadoc) |
|
1306 |
* |
|
1307 |
* @see org.gvsig.metadata.Metadata#getMetadataChildren() |
|
1308 |
*/ |
|
1309 |
public Set getMetadataChildren() { |
|
1310 |
return null; |
|
1311 |
} |
|
1312 |
|
|
1313 |
/* |
|
1314 |
* (non-Javadoc) |
|
1315 |
* |
|
1316 |
* @see org.gvsig.metadata.Metadata#getMetadataName() |
|
1317 |
*/ |
|
1318 |
public String getMetadataName() { |
|
1319 |
return this.provider.getMetadataName(); |
|
1320 |
} |
|
1321 |
|
|
1254 | 1322 |
} |
Also available in: Unified diff