forked from geodmms/xdgnjobs

?? ?
2008-03-25 bde5d88ddded7135aa7188908432d5f147484270
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 + "]");