Revision 3947
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/test/java/org/gvsig/vcsgis/lib/impl/Test03GetWorkspaces.java | ||
---|---|---|
89 | 89 |
|
90 | 90 |
VCSGisWorkspaceDescriptor ws1Descriptor = manager.getWorkspaceDescriptor(ws1.getCode()); |
91 | 91 |
|
92 |
((VCSGisWorkspaceDescriptorImpl)ws1Descriptor).setWorkspace(null);
|
|
92 |
((VCSGisWorkspaceDescriptorImpl)ws1Descriptor).dropCaches();
|
|
93 | 93 |
|
94 | 94 |
VCSGisWorkspace x = manager.openWorkspace(ws1.getExplorer()); |
95 | 95 |
assertTrue("workspace1 is initialized", x != null); |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceDescriptorImpl.java | ||
---|---|---|
192 | 192 |
public void dropExpiredCaches() { |
193 | 193 |
long now = new Date().getTime(); |
194 | 194 |
if (now > this.lastUse+60000) { |
195 |
DisposeUtils.disposeQuietly(this.workspace); |
|
196 |
DisposeUtils.disposeQuietly(this.explorer); |
|
197 |
this.workspace = null; |
|
198 |
this.explorer = null; |
|
195 |
dropCaches(); |
|
199 | 196 |
} |
200 | 197 |
|
201 | 198 |
} |
202 | 199 |
|
200 |
public void dropCaches() { |
|
201 |
DisposeUtils.disposeQuietly(this.workspace); |
|
202 |
DisposeUtils.disposeQuietly(this.explorer); |
|
203 |
this.workspace = null; |
|
204 |
this.explorer = null; |
|
205 |
} |
|
203 | 206 |
|
204 |
|
|
205 | 207 |
} |
Also available in: Unified diff