forked from geodmms/xdgnjobs

?? ?
2008-05-07 1e25c2c090a837ce475ab5a66f99da2ecbecec95
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java
@@ -60,7 +60,7 @@
    private ElementDispatcher elementDispatcher;
    private HashMap featuresContext = new HashMap();
    private HashMap featuresWriterContext = new HashMap();
    private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>();
    private PessimisticMapWrapper txFeaturesContext;
    private JobExecutionContext executionContext;
@@ -189,17 +189,13 @@
                FeatureWriter writer = null;
                if(featuresWriterContext.containsKey(featureType.getTypeName()))
                {
                    writer = (FeatureWriter) featuresWriterContext.get(featureType.getTypeName()) ;
                    writer = featuresWriterContext.get(featureType.getTypeName()) ;
                }
                else
                {
                  ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL());
                  shapefileDataStore.createSchema(featureType);
                  writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT);
                  if(this.featuresWriterContext == null)
                  {
                     this.featuresWriterContext =  new HashMap();
                  }
                  featuresWriterContext.put(featureType.getTypeName() , writer);
                }
@@ -241,16 +237,14 @@
     * Ãö³¬³]³Æ¼g¤J¾¹
     * @throws IOException IOµo¥Í¿ù»~
     */
    public void closeFeatureWrite() throws IOException {
       Iterator iter =   this.featuresWriterContext.values().iterator();
    public void closeFeatureWriter() throws IOException {
        while(iter.hasNext())
        for (FeatureWriter featureWriter : this.featuresWriterContext.values())
        {
           FeatureWriter writer = (FeatureWriter) iter.next();
           writer.close();
            featureWriter.close();
        }
        this.featuresWriterContext = null;
        this.featuresWriterContext.clear();
    }
    /**