gatewayimporttask.java

来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· Java 代码 · 共 68 行

JAVA
68
字号
/** * $RCSfile: GatewayImportTask.java,v $ * $Revision: 1.2 $ * $Date: 2002/03/08 03:49:08 $ * * Copyright (C) 1999-2002 CoolServlets, Inc. All rights reserved. * * This software is the proprietary information of CoolServlets, Inc. * Use is subject to license terms. */package com.jivesoftware.forum.gateway;import java.util.Date;/** * A task that performs a gateway import. */public class GatewayImportTask implements Runnable {    private boolean isBusy  = false;    private boolean hasRun  = false;    private Gateway gateway = null;    private Date afterDate  = new Date();    public GatewayImportTask(Gateway gateway, Date afterDate) {        this.gateway = gateway;        this.afterDate = afterDate;    }    public boolean isBusy() {        return isBusy;    }    public boolean hasRun() {        return hasRun;    }    public void run() {        try {            hasRun = true;            isBusy = true;            gateway.importData(afterDate);        }        catch (GatewayException ge) {            ge.printStackTrace();        }        finally {            isBusy = false;            gateway = null;        }    }    public void stop() {        synchronized(this) {            try {                if (isBusy && gateway != null) {                    GatewayImporter importer = gateway.getGatewayImporter();                    importer.stop();                }            }            catch (GatewayException ge) {                ge.printStackTrace();            }        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?