Revision 41256 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/resource/impl/DefaultResourceManager.java
DefaultResourceManager.java | ||
---|---|---|
337 | 337 |
} |
338 | 338 |
|
339 | 339 |
public synchronized void dispose() throws DisposeResorceManagerException { |
340 |
DisposeResorceManagerException exception = new DisposeResorceManagerException();
|
|
340 |
DisposeResorceManagerException exception = new DisposeResorceManagerException();
|
|
341 | 341 |
|
342 |
try {
|
|
343 |
this.collectResources();
|
|
344 |
} catch (DataException e) {
|
|
345 |
exception.add(e);
|
|
346 |
}
|
|
347 |
Resource res;
|
|
348 |
Iterator iter = this.resources.values().iterator();
|
|
349 |
while (iter.hasNext()) {
|
|
350 |
res = (Resource) iter.next();
|
|
351 |
try {
|
|
352 |
res.closeRequest();
|
|
353 |
if (res.openCount() > 0) {
|
|
354 |
exception
|
|
355 |
.add(new ResourceNotClosedOnDisposeManagerException(
|
|
356 |
res));
|
|
357 |
}
|
|
358 |
iter.remove();
|
|
359 |
} catch (ResourceException e) {
|
|
360 |
exception.add(e);
|
|
361 |
}
|
|
362 |
}
|
|
342 |
try {
|
|
343 |
this.collectResources();
|
|
344 |
} catch (DataException e) {
|
|
345 |
exception.add(e);
|
|
346 |
}
|
|
347 |
Resource res;
|
|
348 |
Iterator iter = this.resources.values().iterator();
|
|
349 |
while (iter.hasNext()) {
|
|
350 |
res = (Resource) iter.next();
|
|
351 |
try {
|
|
352 |
if (res.openCount() > 0) {
|
|
353 |
exception.add(
|
|
354 |
new ResourceNotClosedOnDisposeManagerException(
|
|
355 |
res));
|
|
356 |
}
|
|
357 |
res.closeRequest();
|
|
358 |
iter.remove();
|
|
359 |
} catch (ResourceException e) {
|
|
360 |
exception.add(e);
|
|
361 |
}
|
|
362 |
}
|
|
363 | 363 |
|
364 |
this.resources = null;
|
|
365 |
this.delegateObservable.deleteObservers();
|
|
366 |
this.delegateObservable = null;
|
|
364 |
this.resources = null;
|
|
365 |
this.delegateObservable.deleteObservers();
|
|
366 |
this.delegateObservable = null;
|
|
367 | 367 |
|
368 |
if (!exception.isEmpty()) {
|
|
369 |
throw exception;
|
|
370 |
}
|
|
371 |
}
|
|
368 |
if (!exception.isEmpty()) {
|
|
369 |
throw exception;
|
|
370 |
}
|
|
371 |
}
|
|
372 | 372 |
|
373 | 373 |
public int getTimeToBeIdle() { |
374 | 374 |
if (mlsecondsToBeIdle == 0) { |
Also available in: Unified diff