
com.buabook.spring.configuration.PropertyLoaderConfigurator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-common Show documentation
Show all versions of spring-common Show documentation
Spring functionality (c) 2016 Sport Trades Ltd
The newest version!
package com.buabook.spring.configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.AbstractBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import com.buabook.spring.properties.PropertyLoader;
/**
* Spring Property Loader Configurator
* This {@link Configuration} allows {@link PropertyLoader} to be autowired into any class to dynamically
* query properties loaded by Spring.
* (c) 2017 Sport Trades Ltd
*
* @author Jas Rajasansir
* @version 1.0.0
* @since 5 Jan 2017
*/
@Configuration
public class PropertyLoaderConfigurator {
private static final Logger log = LoggerFactory.getLogger(PropertyLoaderConfigurator.class);
@Autowired
private AbstractBeanFactory abstractBeanFactory;
@Bean
@Scope("singleton")
public PropertyLoader propertyLoader() {
log.debug("Initialising new dynamic property loader with bean factory: " + abstractBeanFactory.toString());
return new PropertyLoader(abstractBeanFactory);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy