Revision 43409 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/spi/JDBCStoreProviderBase.java
JDBCStoreProviderBase.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal.store.jdbc2.spi; |
2 | 2 |
|
3 |
import java.text.MessageFormat; |
|
3 | 4 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProvider; |
4 | 5 |
import java.util.Arrays; |
5 | 6 |
import java.util.Collections; |
6 | 7 |
import java.util.Iterator; |
7 | 8 |
import java.util.List; |
9 |
import java.util.logging.Level; |
|
8 | 10 |
import org.apache.commons.lang3.BooleanUtils; |
9 | 11 |
import org.apache.commons.lang3.StringUtils; |
10 | 12 |
import org.cresques.cts.IProjection; |
... | ... | |
28 | 30 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
29 | 31 |
import org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices; |
30 | 32 |
import org.gvsig.fmap.dal.feature.spi.FeatureSetProvider; |
33 |
import org.gvsig.fmap.dal.resource.ResourceParameters; |
|
34 |
import org.gvsig.fmap.dal.resource.exception.AccessResourceException; |
|
35 |
import org.gvsig.fmap.dal.resource.exception.ResourceException; |
|
36 |
import org.gvsig.fmap.dal.resource.spi.AbstractResource; |
|
31 | 37 |
import org.gvsig.fmap.dal.resource.spi.ResourceConsumer; |
32 | 38 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
33 | 39 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
... | ... | |
382 | 388 |
return this.getHelper().getSourceId(this.getParameters()); |
383 | 389 |
} |
384 | 390 |
|
391 |
private static class DummyResource extends AbstractResource { |
|
392 |
|
|
393 |
private final String name; |
|
394 |
|
|
395 |
DummyResource(String name) throws InitializeException { |
|
396 |
super((ResourceParameters)null); |
|
397 |
this.name = name; |
|
398 |
} |
|
399 |
|
|
400 |
@Override |
|
401 |
public String getName() throws AccessResourceException { |
|
402 |
return MessageFormat.format("DummyResource({0})", |
|
403 |
new Object[] { this.name }); |
|
404 |
} |
|
405 |
|
|
406 |
@Override |
|
407 |
public Object get() throws AccessResourceException { |
|
408 |
return null; |
|
409 |
} |
|
410 |
|
|
411 |
@Override |
|
412 |
public boolean isThis(ResourceParameters parameters) throws ResourceException { |
|
413 |
return true; |
|
414 |
} |
|
415 |
|
|
416 |
} |
|
417 |
|
|
385 | 418 |
@Override |
386 | 419 |
public ResourceProvider getResource() { |
387 |
return getHelper().getResource(); |
|
420 |
ResourceProvider r = getHelper().getResource(); |
|
421 |
if( r == null ) { |
|
422 |
try { |
|
423 |
r = new DummyResource(this.getName()); |
|
424 |
} catch (InitializeException ex) { |
|
425 |
logger.warn("Can't create DummyResource",ex); |
|
426 |
// Do nothing |
|
427 |
} |
|
428 |
} |
|
429 |
return r; |
|
388 | 430 |
} |
389 | 431 |
|
390 | 432 |
@Override |
Also available in: Unified diff