Revision 3630 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
VCSGisWorkspaceDescriptorImpl.java | ||
---|---|---|
27 | 27 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
28 | 28 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
29 | 29 |
import org.gvsig.tools.ToolsLocator; |
30 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
31 |
import org.gvsig.tools.dispose.impl.AbstractDisposable; |
|
30 | 32 |
import org.gvsig.tools.dynobject.DynStruct; |
33 |
import org.gvsig.tools.exception.BaseException; |
|
31 | 34 |
import org.gvsig.tools.persistence.PersistenceManager; |
32 | 35 |
import org.gvsig.tools.persistence.PersistentState; |
33 | 36 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
... | ... | |
40 | 43 |
*/ |
41 | 44 |
@SuppressWarnings("UseSpecificCatch") |
42 | 45 |
public class VCSGisWorkspaceDescriptorImpl |
46 |
extends AbstractDisposable |
|
43 | 47 |
implements VCSGisWorkspaceDescriptor |
44 | 48 |
{ |
45 | 49 |
|
... | ... | |
51 | 55 |
private VCSGisWorkspace workspace; |
52 | 56 |
|
53 | 57 |
public VCSGisWorkspaceDescriptorImpl() { |
54 |
|
|
58 |
super(); |
|
55 | 59 |
} |
56 | 60 |
|
57 | 61 |
public VCSGisWorkspaceDescriptorImpl(VCSGisWorkspace workspace) { |
62 |
this(); |
|
58 | 63 |
this.workspace = workspace; |
59 | 64 |
this.explorerParameters = workspace.getExplorerParameters(); |
60 | 65 |
this.explorer = workspace.getExplorer(); |
... | ... | |
78 | 83 |
VCSGisManager manager = VCSGisLocator.getVCSGisManager(); |
79 | 84 |
this.workspace = manager.openWorkspace(this.getExplorer()); |
80 | 85 |
} |
86 |
DisposeUtils.bind(this.workspace); |
|
81 | 87 |
return this.workspace; |
82 | 88 |
} |
83 | 89 |
|
... | ... | |
156 | 162 |
*/ |
157 | 163 |
public void setWorkspace(VCSGisWorkspace workspace) { |
158 | 164 |
this.workspace = workspace; |
165 |
DisposeUtils.bind(this.workspace); |
|
159 | 166 |
} |
167 |
|
|
168 |
@Override |
|
169 |
protected void doDispose() throws BaseException { |
|
170 |
this.label = null; |
|
171 |
this.code = null; |
|
172 |
this.explorerParameters = null; |
|
173 |
DisposeUtils.disposeQuietly(this.explorer); |
|
174 |
this.explorer = null; |
|
175 |
DisposeUtils.disposeQuietly(this.workspace); |
|
176 |
this.workspace = null; |
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
} |
|
160 | 181 |
|
161 | 182 |
|
162 | 183 |
|
Also available in: Unified diff