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

com.mageddo.togglefirst.spring.ApplicationContextProvider Maven / Gradle / Ivy

There is a newer version: 1.4.9
Show newest version
package com.mageddo.togglefirst.spring;

import org.springframework.beans.BeansException;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;

@ConditionalOnProperty(prefix = "feature-switch", name = "enabled", matchIfMissing = true)
@Configuration
public class ApplicationContextProvider implements ApplicationContextAware {

	private static ApplicationContext context;

	public static ApplicationContext getApplicationContext() {
		return context;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		context = applicationContext;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy