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

com.aggrepoint.dao.spring.boot.DaoContextInitializer Maven / Gradle / Ivy

The newest version!
package com.aggrepoint.dao.spring.boot;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.io.DefaultResourceLoader;

import com.aggrepoint.service.ServiceClassLoader;

/**
 * Enable ServiceClassLoader in Spring Boot application.
 * 
 * @author jiangmingyang
 */
public class DaoContextInitializer implements ApplicationContextInitializer {
	@Override
	public void initialize(ConfigurableApplicationContext context) {
		if (context instanceof DefaultResourceLoader) {
			((DefaultResourceLoader) context).setClassLoader(new ServiceClassLoader(context.getClassLoader()));
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy