Revision 41883 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/resource/spi/AbstractResource.java

View differences:

AbstractResource.java
47 47
import org.gvsig.tools.observer.WeakReferencingObservable;
48 48
import org.gvsig.tools.observer.impl.BaseWeakReferencingObservable;
49 49
import org.gvsig.tools.observer.impl.DelegateWeakReferencingObservable;
50
import org.slf4j.Logger;
51
import org.slf4j.LoggerFactory;
50 52

  
51 53
/**
52 54
 * <p>
......
64 66
public abstract class AbstractResource implements ResourceProvider,
65 67
		WeakReferencingObservable {
66 68

  
69
        private static Logger logger = LoggerFactory.getLogger(AbstractResource.class);
70
                
67 71
	private DelegateWeakReferencingObservable delegateObservable;
68 72

  
69 73
	private List consumers;
......
159 163

  
160 164
	public void notifyClose() throws ResourceNotifyCloseException {
161 165
		if (openCount <= 0) {
162
			throw new IllegalStateException();
163
		}
164
		this.notifyObserver(ResourceNotification.CLOSE);
165
		openCount--;
166
                    try {
167
                        throw new IllegalStateException();
168
                    } catch(IllegalStateException ex) {
169
                        this.
170
                        logger.warn("notify close in a resource already closed ("+this.parameters.toString()+").", ex);
171
                    }
172
                    this.notifyObserver(ResourceNotification.CLOSE);
173
		} else {
174
                    this.notifyObserver(ResourceNotification.CLOSE);
175
                    openCount--;
176
                }
166 177
	}
167 178

  
168 179
	public void notifyChanges() throws ResourceNotifyChangesException {

Also available in: Unified diff