All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.avaje.config.InitPropertiesOnStartup Maven / Gradle / Ivy

The newest version!
package org.avaje.config;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

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

/**
 * Can be used to initialise the AppProperties on Servlet Container start.
 */
@WebListener
public class InitPropertiesOnStartup implements ServletContextListener {

  private static final Logger log = LoggerFactory.getLogger(InitPropertiesOnStartup.class);
  
  @Override
  public void contextInitialized(ServletContextEvent sce) {
    log.info("initialising properties using servlet context");
    AppProperties.init(sce.getServletContext());
  }

  @Override
  public void contextDestroyed(ServletContextEvent sce) {

  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy