/**
 * 
 */
package com.ejie.m62fb.context;

import java.io.InputStream;
import java.util.Properties;

import javax.annotation.PostConstruct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ejie.x38.util.StackTraceManager;
import com.ejie.x38.util.StaticsContainer;
import com.ejie.x38.util.WebContextParameterManager;

/**
XXXX
 */
public class UtilsWebContextParameterManager
extends WebContextParameterManager {
	
	 private static Logger logger = LoggerFactory.getLogger("UtilsWebContextParameterManager");
	 
	 @Override
	@PostConstruct
	 public void init()
	 {
		 super.init();
		 Properties props = new Properties();
		 try {
			logger.debug("Loading properties from: " + StaticsContainer.webAppName + "/" + StaticsContainer.webAppName + ".properties");
			InputStream in = super.getClass().getClassLoader().getResourceAsStream(StaticsContainer.webAppName + "/" + StaticsContainer.webAppName + ".properties");
			props.load(in);
			in.close();
		} catch (Exception e) {
			logger.error(StackTraceManager.getStackTrace(e));
		}
		 
		logger.info("WARs specific entorno is: " + props.getProperty("entornoAplic"));
		UtilsStaticsContainer.entornoAplic = props.getProperty("entornoAplic");
		UtilsStaticsContainer.versionStatics = props.getProperty("estaticos.version");

	 }
	
}
