Mercurial > hg > openmind
changeset 44:23c043a19134
moved servlet lifecycle listener to ismi-richfaces.
author | casties |
---|---|
date | Thu, 20 Oct 2016 14:04:36 +0200 |
parents | a270b5e73bda |
children | fd98c31371cb |
files | pom.xml src/main/java/org/mpi/openmind/repository/services/ServiceRegistry.java |
diffstat | 2 files changed, 13 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/pom.xml Tue Oct 18 12:17:35 2016 +0200 +++ b/pom.xml Thu Oct 20 14:04:36 2016 +0200 @@ -135,6 +135,11 @@ <artifactId>spring-tx</artifactId> <version>3.0.0.RELEASE</version> </dependency> + <!-- <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>3.0.0.RELEASE</version> + </dependency> --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-support</artifactId> @@ -152,12 +157,13 @@ </dependency> - <dependency> + <!-- <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> - </dependency> + </dependency> --> + </dependencies> <build>
--- a/src/main/java/org/mpi/openmind/repository/services/ServiceRegistry.java Tue Oct 18 12:17:35 2016 +0200 +++ b/src/main/java/org/mpi/openmind/repository/services/ServiceRegistry.java Thu Oct 20 14:04:36 2016 +0200 @@ -2,16 +2,12 @@ import java.io.Serializable; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - import org.apache.log4j.Logger; import org.mpi.openmind.cache.WrapperService; import org.mpi.openmind.configuration.ConfigurationService; import org.mpi.openmind.search.SearchService; import org.mpi.openmind.security.SecurityService; import org.springframework.context.ApplicationContext; -import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.scheduling.quartz.CronTriggerBean; @@ -19,7 +15,7 @@ * * @author jurzua */ -public class ServiceRegistry implements Serializable, ServletContextListener { +public class ServiceRegistry implements Serializable { private static final long serialVersionUID = 3883885508641723220L; @@ -77,27 +73,10 @@ return (CronTriggerBean) context.getBean(CRON); } + public ApplicationContext getApplicationContext() { + return this.context; + } + public static void main(String[] args) {} - /* (non-Javadoc) - * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) - */ - @Override - public void contextInitialized(ServletContextEvent arg0) { - logger.info("Servlet context initialized."); - } - - /* (non-Javadoc) - * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) - */ - @Override - public void contextDestroyed(ServletContextEvent arg0) { - if (context != null) { - // run Spring shutdown hook - logger.info("Closing Spring context."); - ((AbstractApplicationContext) context).close(); - } - logger.info("Servlet context destroyed."); - } - }