/*
 * This is part of Geomajas, a GIS framework, http://www.geomajas.org/.
 *
 * Copyright 2008-2012 Geosparc nv, http://www.geosparc.com/, Belgium.
 *
 * The program is available in open source according to the GNU Affero
 * General Public License. All contributions in this program are covered
 * by the Geomajas Contributors License Agreement. For full licensing
 * details, see LICENSE.txt in the project root.
 */
package org.geomajas.servlet;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;

import org.geomajas.annotation.Api;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * Utility class to obtain the (Spring) applicationContext from the servlet.
 *
 * @author Joachim Van der Auwera
 * @since 1.7.0
 * @deprecated use {@link org.springframework.web.context.ContextLoaderListener}
 */
@Api(allMethods = true)
@Deprecated
public final class ApplicationContextUtil {

	private static final String GEOMAJAS_SPRING_CONTEXT = "Geomajas-Spring-context";

	private ApplicationContextUtil() {
	}

	public static ApplicationContext getApplicationContext(ServletConfig servletConfig) {
		return getApplicationContext(servletConfig.getServletContext());
	}

	public static ApplicationContext getApplicationContext(ServletContext servletContext) {
		return WebApplicationContextUtils.getWebApplicationContext(servletContext);
	}

	public static void setApplicationContext(ServletContext servletContext, ApplicationContext applicationContext) {
		servletContext.setAttribute(GEOMAJAS_SPRING_CONTEXT, applicationContext);
	}
}

@@ -1103,24 +1103,158 @@
 til() %7B%0A%09%7D%0A%0A
+%09/**%0A%09 * Get the Geomajas application context.%0A%09 *%0A%09 * @param servletConfig servlet configuration%0A%09 * @return application config%0A%09 */%0A
 %09public stat
@@ -1395,24 +1395,153 @@
 ext());%0A%09%7D%0A%0A
+%09/**%0A%09 * Get the Geomajas application context.%0A%09 *%0A%09 * @param servletContext servlet context%0A%09 * @return application config%0A%09 */%0A
 %09public stat
@@ -1699,16 +1699,164 @@
 t);%0A%09%7D%0A%0A
+%09/**%0A%09 * Set the Geomajas application context.%0A%09 *%0A%09 * @param servletContext servlet context%0A%09 * @param applicationContext application context%0A%09 */%0A
 %09public 

add javadoc on api methods