Revision 43270

View differences:

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/feature/impl/DefaultFeatureStore.java
205 205
    private FeatureCacheProvider cache;
206 206

  
207 207
    StateInformation state;
208
    
208

  
209 209
    FeatureStoreTimeSupport timeSupport;
210 210

  
211 211

  
......
215 215

  
216 216
        private boolean broken;
217 217
        private Throwable breakingsCause;
218
    
218

  
219 219
        public StateInformation() {
220 220
            this.clear();
221 221
        }
222
        
222

  
223 223
        @Override
224 224
        public void clear() {
225 225
            this.broken = false;
226 226
            this.breakingsCause = null;
227 227
            super.clear();
228 228
        }
229
        
229

  
230 230
        public boolean isBroken() {
231 231
            return this.broken;
232 232
        }
233
        
233

  
234 234
        public void broken() {
235 235
            this.broken = true;
236 236
        }
237
        
237

  
238 238
        public Throwable getBreakingsCause() {
239 239
            return this.breakingsCause;
240 240
        }
241
        
241

  
242 242
        public void setBreakingsCause(Throwable cause) {
243 243
            if( this.breakingsCause==null ) {
244 244
                this.breakingsCause = cause;
245 245
            }
246 246
            this.broken = true;
247
        }        
247
        }
248 248
    }
249
    
250 249

  
251 250

  
251

  
252 252
    /*
253 253
     * TODO:
254 254
     *
......
534 534
        state.set("defaultFeatureTypeId", defaultFeatureType.getId());
535 535

  
536 536
    }
537
    
537

  
538 538
    @Override
539 539
    public void loadFromState(final PersistentState persistentState)
540 540
        throws PersistenceException {
......
571 571
            state.setBreakingsCause(th);
572 572
        }
573 573
        load(state);
574
    }        
575
        
576
    private void load(StateInformation state) {   
574
    }
575

  
576
    private void load(StateInformation state) {
577 577
        this.featureTypes = new ArrayList();
578 578
        this.defaultFeatureType = null;
579 579
        this.featureCount = null;
......
653 653
            state.setBreakingsCause(th);
654 654
        }
655 655

  
656
                                
656

  
657 657
        try {
658 658
            String defaultFeatureTypeId = (String) state.get("defaultFeatureTypeId");
659 659
            FeatureType ftype;
......
681 681
            state.setBreakingsCause(th);
682 682
        }
683 683

  
684
        LOG.info("load() broken:{}, {}, {}.", 
684
        LOG.info("load() broken:{}, {}, {}.",
685 685
                new Object[] { state.isBroken(), this.getProviderName(), params }
686 686
        );
687 687
    }
......
689 689
	public DataStoreProviderServices getStoreProviderServices() {
690 690
		return this;
691 691
	}
692
	
692

  
693 693
    public static void registerPersistenceDefinition() {
694 694
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
695 695
        if (manager.getDefinition(PERSISTENCE_DEFINITION_NAME) == null) {
......
966 966
        if (observable instanceof FeatureSet) {
967 967
            if (observable == this.selection) {
968 968
                this.notifyChange(DataStoreNotification.SELECTION_CHANGE);
969
            } else
970
                if (observable == this.locks) {
971
                    this.notifyChange(FeatureStoreNotification.LOCKS_CHANGE);
972
                }
969
            } else if (observable == this.locks) {
970
                this.notifyChange(FeatureStoreNotification.LOCKS_CHANGE);
971
            }
973 972

  
974
        } else
975
            if (observable instanceof FeatureStoreProvider) {
976
                if (observable == this.provider) {
973
        } else if (observable instanceof FeatureStoreProvider) {
974
            if (observable == this.provider) {
977 975

  
978
                }
979

  
980 976
            }
977
        } else if (observable instanceof FeatureReferenceSelection) {
978
            if(notification instanceof String){
979
                    this.notifyChange((String)notification);
980
            }
981
        }
981 982
    }
982 983

  
983 984
    //
......
2266 2267
		}
2267 2268
        return this.metadata.hasDynValue(name);
2268 2269
    }
2269
    
2270

  
2270 2271
    @Override
2271 2272
    public boolean hasDynMethod(String name) {
2272 2273
        return ((DynObject_v2)this.metadata).hasDynMethod(name);
2273 2274
    }
2274
    
2275

  
2275 2276
    @Override
2276 2277
    public void implement(DynClass dynClass) {
2277 2278
        this.metadata.implement(dynClass);
......
2441 2442
            return this.parameters.getDataStoreName();
2442 2443
        }
2443 2444
        return null;
2444
        
2445

  
2445 2446
    }
2446 2447

  
2447 2448
    @Override
......
2572 2573
    public void useCache(String providerName, DynObject parameters) throws DataException {
2573 2574
        throw new UnsupportedOperationException();
2574 2575
    }
2575
    
2576

  
2576 2577
    @Override
2577 2578
    public boolean isBroken() {
2578 2579
        return this.state.isBroken();

Also available in: Unified diff