com.pureinfo.srm.sendoutlayunit.engines.SRMOutlayUnitEngine.java Source code

Java tutorial

Introduction

Here is the source code for com.pureinfo.srm.sendoutlayunit.engines.SRMOutlayUnitEngine.java

Source

/**
 * PureInfo Command
 * @(#)SRMOutlayUnitEngine.java   1.0 2008-12-4
 * 
 * Copyright(c) 2004-2005, PureInfo Information Technology Corp. Ltd. 
 * All rights reserved, see the license file.
 * 
 * www.pureinfo.com.cn
 */

package com.pureinfo.srm.sendoutlayunit.engines;

import java.util.Timer;
import java.util.TimerTask;

import org.apache.commons.lang.time.DateUtils;
import org.apache.log4j.Logger;

import com.pureinfo.force.exception.PureException;
import com.pureinfo.force.runtime.engine.EngineBase;
import com.pureinfo.srm.sendoutlayunit.model.SendToCWC;

public class SRMOutlayUnitEngine extends EngineBase {

    private static final Logger logger = Logger.getLogger(SRMOutlayUnitEngine.class);

    private Timer m_timer = new Timer();

    /**  */
    private final long DELAY = DateUtils.MILLIS_PER_SECOND * 10;

    /**  */
    private final long PERIOD = DateUtils.MILLIS_PER_SECOND * 300;

    protected void doShutdown() throws PureException {
        // TODO Auto-generated method stub
        if (m_timer != null) {
            m_timer.cancel();
            m_timer = null;
        }

    }

    protected void doStartup() throws PureException {
        // TODO Auto-generated method stub
        if (logger.isInfoEnabled()) {
            logger.info("outlayunit engine startup.");
        }

        m_timer = new Timer();
        m_timer.schedule(new TimerTask() {
            public void run() {
                try {

                } catch (Exception e) {
                    logger.warn("outlayunit engine error,", e);
                }
            }
        }, DELAY, PERIOD);

    }

}