forked from geodmms/xdgnjobs

?? ?
2008-03-25 bde5d88ddded7135aa7188908432d5f147484270
update for EOFM-19
2 files modified
29 ■■■■■ changed files
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java 17 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java 12 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java
@@ -64,7 +64,7 @@
        return logger;
    }
    protected OracleConvertJobContext prepareJobContext(String filterPath)
    protected AbstractOracleJobContext prepareJobContext(String filterPath)
    {
        return new OracleConvertJobContext(filterPath);
    }
@@ -81,10 +81,11 @@
        logger.info(jobName + " fired at " + new Date());
        extractJobConfiguration(jobDetail);
        OracleConvertJobContext jobContext = prepareJobContext(_filterPath);
        OracleConvertJobContext jobContext = (OracleConvertJobContext) prepareJobContext(_filterPath);
        jobContext.setConnectionInfo(_oracleHost, _oraclePort, _oracleInstance);
        jobContext.setLogin(_username, _password);
        jobContext.setShapeData(_dataPath);
        jobContext.setExecutionContext(context);
        try
        {
@@ -106,6 +107,10 @@
        logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode);
        jobContext.startTransaction();
        int total = map.size();
        int step = total / 100;
        int current = 0;
        jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", 0);
        for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();)
        {
            it.next();
@@ -131,7 +136,15 @@
                jobContext.commitTransaction();
                System.gc();
            }
            int now = order % step;
            if (now != current)
            {
                current = now;
                jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", current);
            }
        }
        jobContext.getExecutionContext().put("ConvertDgn2ShpJobProgress", 100);
        jobContext.commitTransaction();
        logger.info("end convert job:[" + order + "]");
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java
@@ -29,6 +29,7 @@
import org.geotools.feature.IllegalAttributeException;
import org.geotools.feature.SimpleFeature;
import org.xml.sax.SAXException;
import org.quartz.JobExecutionContext;
import com.vividsolutions.jts.util.Assert;
@@ -59,6 +60,8 @@
    private HashMap featuresContext = new HashMap();
    private PessimisticMapWrapper txFeaturesContext;
    private JobExecutionContext executionContext;
    public OracleConvertJobContext(String filterConfig)
    {
@@ -201,4 +204,13 @@
    }
    public JobExecutionContext getExecutionContext()
    {
        return executionContext;
    }
    public void setExecutionContext(JobExecutionContext context)
    {
        executionContext = context;
    }
}