
com.mageddo.featureswitch.spring.ApplicationContextProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of feature-switch Show documentation
Show all versions of feature-switch Show documentation
Simplify Consumer And Producer Configuration
The newest version!
package com.mageddo.featureswitch.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 - 2025 Weber Informatics LLC | Privacy Policy