From f4f361e0e8af41e3d12ee3e36a1ba11e60a12077 Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 6 Dec 2010 16:55:24 +0000 Subject: Moved to pdf-as-web project git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@676 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../egov/egiz/web/PdfASServletContextListener.java | 116 --------------------- 1 file changed, 116 deletions(-) delete mode 100644 src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java deleted file mode 100644 index 32cfc1e..0000000 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright (c) 2006 by Know-Center, Graz, Austria - * - * This software is the confidential and proprietary information of Know-Center, - * Graz, Austria. You shall not disclose such Confidential Information and shall - * use it only in accordance with the terms of the license agreement you entered - * into with Know-Center. - * - * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF - * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR - * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY - * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS - * DERIVATIVES. - * - * $Id: PdfASServletContextListener.java,v 1.3 2006/10/31 08:22:04 wprinz Exp $ - */ -package at.knowcenter.wag.egov.egiz.web; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; - -import at.gv.egiz.pdfas.api.commons.Constants; -import at.gv.egiz.pdfas.utils.ConfigUtils; -import at.knowcenter.wag.egov.egiz.cfg.ConfigLogger; -import at.knowcenter.wag.egov.egiz.cfg.SettingsReader; -import at.knowcenter.wag.egov.egiz.exceptions.SettingsException; - -/** - * The ServletContextListener is notified when the webapplication starts up and shuts down. - * - *

- * Maintainance work is performed. - *

- * - * @author wprinz - */ -public class PdfASServletContextListener implements ServletContextListener -{ - /** - * The logger. - */ - private static final Logger logger = ConfigLogger.getLogger(PdfASServletContextListener.class); - - - /** - * The servlet init parameter that may be used to declare the pdf-as configuration folder. The - * init parameter may be set in web.xml or in META-INF/context.xml resp. - * conf/Catalina/localhost/pdf-as.xml if deployed. - */ - private final static String CONFIG_SERVLET_INIT_PARAMETER = "work-dir"; - - /** - * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) - */ - public void contextInitialized(ServletContextEvent sce) - { - logger.info("PDF-AS Context init"); //$NON-NLS-1$ - - String sysPropWorkdir = System.getProperty(Constants.CONFIG_DIR_SYSTEM_PROPERTY); - String scWorkdir = sce.getServletContext().getInitParameter(CONFIG_SERVLET_INIT_PARAMETER); - - String work_dir; - - // search for system property - if (!StringUtils.isEmpty(sysPropWorkdir)) { - work_dir = sysPropWorkdir; - logger.debug("Work-dir configuration via system property \"" + Constants.CONFIG_DIR_SYSTEM_PROPERTY + "\" = \"" + sysPropWorkdir + "\"."); - - // search for servlet parameter - } else if (!StringUtils.isEmpty(scWorkdir)){ - work_dir = scWorkdir; - logger.debug("Work-dir configuration via servlet init parameter \"" + CONFIG_SERVLET_INIT_PARAMETER + "\" = \"" + scWorkdir + "\"."); - - // assume configuration to be located in webapp path - } else { - work_dir = sce.getServletContext().getRealPath("/"); - logger.info("PDF-AS work-dir not explicitely given. Assuming configuration is located in webapp folder \"" + work_dir + "\"."); - } - - logger.info("PDF-AS configuration location = \"" + work_dir + "\""); - -// try -// { -// logger.info("PDF-AS work directory = " + new File(work_dir).getCanonicalPath()); //$NON-NLS-1$ -// logger.info("PDF-AS base directory = " + new File(base_dir).getCanonicalPath()); //$NON-NLS-1$ -// } -// catch (IOException e) -// { -// e.printStackTrace(); -// } - - - SettingsReader.initializeForWeb(work_dir); - ConfigUtils.initializeLogger(); - try { - SettingsReader.getInstance(); - } catch (SettingsException e) { - logger.error(e.getMessage(), e); - } - - SettingsReader.clearTemporaryDirectory(); - } - - /** - * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) - */ - public void contextDestroyed(ServletContextEvent sce) - { - SettingsReader.clearTemporaryDirectory(); - logger.info("PDF-AS Context exit"); //$NON-NLS-1$ - } -} -- cgit v1.2.3