initializationservletwithoutviews.java

来自「OPIAM stands for Open Identity and Acces」· Java 代码 · 共 57 行

JAVA
57
字号
/*
 * OPIAM Suite
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package opiam.admin.faare.struts.utils;

import opiam.admin.faare.PropertiesManager;
import opiam.admin.faare.struts.managers.AppliParametersManager;

import org.apache.log4j.Logger;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;


/**
 * Class which initializes an application.
 *
 */
public class InitializationServletWithoutViews extends HttpServlet
{
    /**
     * @see javax.servlet.Servlet#init(ServletConfig).
     * Loads configuration and services and loads logical views names.
     */
    public void init(ServletConfig arg0) throws ServletException
    {
        super.init(arg0);

        Logger logger = Logger.getLogger(InitializationServletWithoutViews.class);

        try
        {
            PropertiesManager.getInstance();
            AppliParametersManager.initialize();
            this.getServletContext().setAttribute("init_success", "true");
        }
        catch (RuntimeException e)
        {
            this.getServletContext().removeAttribute("init_success");
            logger.error("****************************************************");
            logger.error(
                " INITIALIZATIONSERVLETWITHOUTVIEWS FAILED. PLEASE REBOOT THE WEBAPP !");
            logger.error("****************************************************");
            throw new ServletException("InitializationServletWithoutViews failed");
        }

        logger.info("******************************************");
        logger.info(" INITIALIZATIONSERVLETWITHOUTVIEWS ENDED SUCCESSFULLY");
        logger.info("******************************************");
    }
}

⌨️ 快捷键说明

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