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

📄 syslistener.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:   SysListener.java

package com.laoer.bbscs.web.servlet;

import com.laoer.bbscs.lucene.IndexHTML;
import com.laoer.bbscs.sys.*;
import java.io.IOException;
import java.util.Properties;
import java.util.Timer;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.support.AbstractApplicationContext;

public class SysListener extends HttpServlet
    implements ServletContextListener
{

    private static final Log logger;
    Timer aTimer;
    static Class class$com$laoer$bbscs$web$servlet$SysListener; /* synthetic field */

    public SysListener()
    {
        aTimer = new Timer(true);
    }

    public void contextInitialized(ServletContextEvent sce)
    {
        String rootpath = sce.getServletContext().getRealPath("/");
        if(rootpath != null)
            rootpath = rootpath.replaceAll("\\\\", "/");
        else
            rootpath = "/";
        if(!rootpath.endsWith("/"))
            rootpath = rootpath + "/";
        Constant.ROOTPATH = rootpath;
        logger.info("Application Run Path:" + rootpath);
        Properties prop = new Properties();
        java.io.InputStream stream = getClass().getResourceAsStream("/configpath.properties");
        try
        {
            prop.load(stream);
            String config_path = prop.getProperty("config_path");
            if(!config_path.endsWith("/"))
                config_path = config_path + "/";
            if(config_path.equals("/") || config_path.equals("/WEB-INF/classes/"))
                Constant.CONFIGPATH = rootpath + "WEB-INF/classes/";
            else
                Constant.CONFIGPATH = config_path;
        }
        catch(IOException ex)
        {
            logger.error(ex);
            Constant.CONFIGPATH = rootpath + "WEB-INF/classes/";
        }
        logger.info("Application Run ConfigPath:" + Constant.CONFIGPATH);
        AppContext.getInstance();
        if(SysInfo.getInstance().getBoardthread() > 0)
            aTimer.schedule(BoardLoadTimerTask.getInstance(), SysInfo.getInstance().getBoardthread() * 60 * 1000, SysInfo.getInstance().getBoardthread() * 60 * 1000);
        if(SysInfo.getInstance().getIndexall() == 1)
        {
            logger.info("Create index all......");
            IndexHTML.doIndex(true);
        }
        aTimer.schedule(new IndexTimerTask(), SysInfo.getInstance().getIndextime() * 60 * 1000, SysInfo.getInstance().getIndextime() * 60 * 1000);
    }

    public void contextDestroyed(ServletContextEvent sce)
    {
        aTimer.cancel();
        AppContext.getInstance().getAppContext().close();
    }

    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$web$servlet$SysListener != null ? class$com$laoer$bbscs$web$servlet$SysListener : (class$com$laoer$bbscs$web$servlet$SysListener = class$("com.laoer.bbscs.web.servlet.SysListener")));
    }
}

⌨️ 快捷键说明

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