Revision 25785 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/spi/AbstractFeatureStoreProvider.java
AbstractFeatureStoreProvider.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
import org.gvsig.fmap.dal.DALLocator; |
6 | 6 |
import org.gvsig.fmap.dal.DataServerExplorer; |
7 |
import org.gvsig.fmap.dal.exception.*; |
|
7 |
import org.gvsig.fmap.dal.exception.CloseException; |
|
8 |
import org.gvsig.fmap.dal.exception.DataException; |
|
9 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
10 |
import org.gvsig.fmap.dal.exception.OpenException; |
|
11 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
8 | 12 |
import org.gvsig.fmap.dal.feature.FeatureLocks; |
9 | 13 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
10 | 14 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
14 | 18 |
import org.gvsig.fmap.dal.resource.spi.ResourceManagerProviderServices; |
15 | 19 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
16 | 20 |
import org.gvsig.fmap.geom.primitive.Envelope; |
17 |
import org.gvsig.metadata.Metadata; |
|
18 |
import org.gvsig.metadata.exceptions.MetadataNotFoundException; |
|
21 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
22 |
import org.gvsig.tools.dynobject.DynClass; |
|
23 |
import org.gvsig.tools.dynobject.DynObject; |
|
24 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
|
25 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
|
19 | 26 |
import org.slf4j.Logger; |
20 | 27 |
import org.slf4j.LoggerFactory; |
21 | 28 |
|
... | ... | |
25 | 32 |
|
26 | 33 |
protected FeatureStoreProviderServices store; |
27 | 34 |
protected Logger logger; |
35 |
protected DelegatedDynObject dynObject; |
|
28 | 36 |
|
29 | 37 |
public AbstractFeatureStoreProvider() { |
30 | 38 |
this.store = null; |
31 | 39 |
this.logger = null; |
40 |
this.dynObject = null; |
|
32 | 41 |
} |
33 | 42 |
|
34 | 43 |
|
35 | 44 |
public FeatureStoreProvider initialize(FeatureStoreProviderServices store) |
36 | 45 |
throws InitializeException { |
37 | 46 |
this.store = store; |
38 |
this.logger = null; |
|
39 | 47 |
return this; |
40 | 48 |
} |
41 | 49 |
|
... | ... | |
96 | 104 |
} |
97 | 105 |
|
98 | 106 |
public void dispose() throws CloseException { |
99 |
// Do nothing by default |
|
107 |
this.dynObject = null; |
|
108 |
this.store = null; |
|
109 |
this.logger = null; |
|
100 | 110 |
} |
101 | 111 |
|
102 |
public Iterator getChilds() {
|
|
112 |
public Envelope getEnvelope() throws DataException {
|
|
103 | 113 |
return null; |
104 | 114 |
} |
105 | 115 |
|
106 |
public Envelope getEnvelope() throws DataException { |
|
107 |
return null; |
|
116 |
public abstract DataServerExplorer getExplorer() throws ReadException; |
|
117 |
|
|
118 |
public abstract void performEditing(Iterator deleteds, Iterator inserteds, Iterator updateds) throws PerformEditingException; |
|
119 |
|
|
120 |
|
|
121 |
public void delegate(DynObject dynObject) { |
|
122 |
if (this.dynObject == null) { |
|
123 |
return; |
|
124 |
} |
|
125 |
this.dynObject.delegate(dynObject); |
|
108 | 126 |
} |
109 | 127 |
|
110 |
public Metadata getMetadata() throws MetadataNotFoundException { |
|
111 |
return null; |
|
128 |
public DynClass getDynClass() { |
|
129 |
if (this.dynObject == null) { |
|
130 |
return null; |
|
131 |
} |
|
132 |
return this.dynObject.getDynClass(); |
|
112 | 133 |
} |
113 | 134 |
|
114 |
public abstract DataServerExplorer getExplorer() throws ReadException; |
|
135 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
|
136 |
if (this.dynObject == null) { |
|
137 |
return null; |
|
138 |
} |
|
139 |
return this.getDynValue(name); |
|
140 |
} |
|
115 | 141 |
|
116 |
public abstract void performEditing(Iterator deleteds, Iterator inserteds, Iterator updateds) throws PerformEditingException; |
|
142 |
public boolean hasDynValue(String name) { |
|
143 |
if (this.dynObject == null) { |
|
144 |
return false; |
|
145 |
} |
|
146 |
return this.hasDynValue(name); |
|
147 |
} |
|
117 | 148 |
|
149 |
public void implement(DynClass dynClass) { |
|
150 |
if (this.dynObject == null) { |
|
151 |
return; |
|
152 |
} |
|
153 |
this.implement(dynClass); |
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
public Object invokeDynMethod(int code, DynObject context) |
|
158 |
throws DynMethodException { |
|
159 |
if (this.dynObject == null) { |
|
160 |
return null; |
|
161 |
} |
|
162 |
|
|
163 |
return this.dynObject.invokeDynMethod(this, code, context); |
|
164 |
} |
|
165 |
|
|
166 |
public Object invokeDynMethod(String name, DynObject context) |
|
167 |
throws DynMethodException { |
|
168 |
if (this.dynObject == null) { |
|
169 |
return null; |
|
170 |
} |
|
171 |
|
|
172 |
return this.dynObject.invokeDynMethod(this, name, context); |
|
173 |
} |
|
174 |
|
|
175 |
public void setDynValue(String name, Object value) |
|
176 |
throws DynFieldNotFoundException { |
|
177 |
if (this.dynObject == null) { |
|
178 |
return; |
|
179 |
} |
|
180 |
|
|
181 |
this.dynObject.setDynValue(name, value); |
|
182 |
} |
|
183 |
|
|
118 | 184 |
} |
Also available in: Unified diff