⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysstat.java

📁 反ajax原代码
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   SysStat.java

package com.laoer.bbscs.sys;

import com.laoer.comm.util.Util;
import java.io.*;
import java.util.Date;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

// Referenced classes of package com.laoer.bbscs.sys:
//            SysUtil

public class SysStat
{

    private static final Log logger;
    public static SysStat instance;
    private int onlinenum;
    private long appeartime;
    private String appeartimestr;
    private int allusernum;
    private String lastreguser;
    private int postmainnum;
    private int postnum;
    static Class class$com$laoer$bbscs$sys$SysStat; /* synthetic field */

    public static synchronized SysStat getInstance()
    {
        if(instance == null)
            instance = new SysStat();
        return instance;
    }

    public SysStat()
    {
        onlinenum = 0;
        appeartime = 0L;
        appeartimestr = "";
        allusernum = 0;
        postmainnum = 0;
        postnum = 0;
        load();
    }

    public void load()
    {
        Properties prop = new Properties();
        try
        {
            File f = new File(SysUtil.getIncludeFilePath() + "sysstat.properties");
            if(!f.exists())
                f.createNewFile();
            FileInputStream fis = new FileInputStream(f);
            prop.load(fis);
            onlinenum = Integer.parseInt(prop.getProperty("onlinenum", "0").trim());
            appeartime = Long.parseLong(prop.getProperty("appeartime", "0").trim());
            allusernum = Integer.parseInt(prop.getProperty("allusernum", "0").trim());
            lastreguser = prop.getProperty("lastreguser", "");
            postmainnum = Integer.parseInt(prop.getProperty("postmainnum", "0").trim());
            postnum = Integer.parseInt(prop.getProperty("postnum", "0").trim());
            appeartimestr = Util.formatDateTime(new Date(appeartime));
        }
        catch(IOException ex)
        {
            logger.error(ex);
        }
    }

    public synchronized void setOnline(int nowonlinenum)
    {
        if(nowonlinenum > onlinenum)
        {
            long atime = Util.getLongTime();
            onlinenum = nowonlinenum;
            appeartime = atime;
            appeartimestr = Util.formatDateTime(new Date(atime));
            save();
        }
    }

    public synchronized void setAllUserNum(int allusernum, String lastreguser)
    {
        this.allusernum = allusernum;
        this.lastreguser = lastreguser;
        save();
    }

    public synchronized void setPostNum(int main, int all)
    {
        postmainnum = main;
        postnum = all;
        save();
    }

    public void save()
    {
        String path = SysUtil.getIncludeFilePath() + "sysstat.properties";
        Properties prop = new Properties();
        prop.setProperty("onlinenum", String.valueOf(onlinenum));
        prop.setProperty("appeartime", String.valueOf(appeartime));
        prop.setProperty("allusernum", String.valueOf(allusernum));
        prop.setProperty("lastreguser", lastreguser);
        prop.setProperty("postnum", String.valueOf(postnum));
        prop.setProperty("postmainnum", String.valueOf(postmainnum));
        try
        {
            FileOutputStream fos = new FileOutputStream(path);
            prop.store(fos, "sysstat.properties");
            fos.close();
        }
        catch(FileNotFoundException ex)
        {
            logger.error(ex);
        }
        catch(IOException ex)
        {
            logger.error(ex);
        }
    }

    public int getOnlinenum()
    {
        return onlinenum;
    }

    public void setOnlinenum(int onlinenum)
    {
        this.onlinenum = onlinenum;
    }

    public long getAppeartime()
    {
        return appeartime;
    }

    public void setAppeartime(long appeartime)
    {
        this.appeartime = appeartime;
    }

    public String getAppeartimestr()
    {
        return appeartimestr;
    }

    public void setAppeartimestr(String appeartimestr)
    {
        this.appeartimestr = appeartimestr;
    }

    public int getAllusernum()
    {
        return allusernum;
    }

    public void setAllusernum(int allusernum)
    {
        this.allusernum = allusernum;
    }

    public String getLastreguser()
    {
        return lastreguser;
    }

    public void setLastreguser(String lastreguser)
    {
        this.lastreguser = lastreguser;
    }

    public int getPostmainnum()
    {
        return postmainnum;
    }

    public void setPostmainnum(int postmainnum)
    {
        this.postmainnum = postmainnum;
    }

    public int getPostnum()
    {
        return postnum;
    }

    public void setPostnum(int postnum)
    {
        this.postnum = postnum;
    }

    static Class class$(String x0)
    {
        return Class.forName(x0);
        ClassNotFoundException x1;
        x1;
        throw new NoClassDefFoundError(x1.getMessage());
    }

    static 
    {
        logger = LogFactory.getLog(class$com$laoer$bbscs$sys$SysStat != null ? class$com$laoer$bbscs$sys$SysStat : (class$com$laoer$bbscs$sys$SysStat = class$("com.laoer.bbscs.sys.SysStat")));
    }
}

⌨️ 快捷键说明

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