Spring Framework AnnotationConfigContextLoader - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AnnotationConfigContextLoader class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
 * used from {@link YarnDelegatingSmartContextLoader}. 
 * 
 * @author Janne Valkealahti 
 * 
 */ 
public class YarnClusterInjectingAnnotationConfigContextLoader extends AnnotationConfigContextLoader {
 
	private final static Log log = LogFactory.getLog(YarnClusterInjectingAnnotationConfigContextLoader.class);
 
	@Override 
	protected void loadBeanDefinitions(GenericApplicationContext context,
			MergedContextConfiguration mergedConfig) {
 
		String[] activeProfiles = context.getEnvironment().getActiveProfiles();
		log.info("Active profiles: " + StringUtils.arrayToCommaDelimitedString(activeProfiles));
 
		// let parent do its magic 
		super.loadBeanDefinitions(context, mergedConfig);
		if (!ObjectUtils.containsElement(activeProfiles, YarnTestSystemConstants.PROFILE_ID_NOMINICLUSTER)) {
			YarnClusterInjectUtils.handleClusterInject(context, mergedConfig);
4
CodeRank
This code example shows how to use the following methods:
 * used from {@link HadoopDelegatingSmartContextLoader}. 
 * 
 * @author Janne Valkealahti 
 * 
 */ 
public class HadoopClusterInjectingAnnotationConfigContextLoader extends AnnotationConfigContextLoader { 
 
	@Override 
	protected void loadBeanDefinitions(GenericApplicationContext context, 
			MergedContextConfiguration mergedConfig) { 
 
		// let parent do its magic 
		super.loadBeanDefinitions(context, mergedConfig); 
		HadoopClusterInjectUtils.handleClusterInject(context, mergedConfig); 
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:
package org.lightadmin.core.test; 
 
import org.lightadmin.core.util.LightAdminConfigurationUtils; 
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.mock.env.MockPropertySource;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
 
public class LightAdminConfigurationContextLoader extends AnnotationConfigContextLoader {
 
	private static final String CONFIGURATIONS_BASE_PACKAGE = "org.lightadmin.core.test.config";
 
	@Override 
	protected void customizeContext( final GenericApplicationContext context ) {
		MockPropertySource mockPropertySource = new MockPropertySource();
		mockPropertySource.setProperty( LightAdminConfigurationUtils.LIGHT_ADMINISTRATION_BASE_PACKAGE, CONFIGURATIONS_BASE_PACKAGE );
		context.getEnvironment().getPropertySources().addFirst( mockPropertySource );
	} 
} 

4
CodeRank