com.github.lontime.extspring.configuration.CopperAutoConfiguration Maven / Gradle / Ivy
package com.github.lontime.extspring.configuration;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.github.lontime.extspring.components.CopperComponentExt;
import com.github.lontime.extspring.impl.copper.SpringDependencyInjector;
import org.copperengine.core.DependencyInjector;
/**
* CopperAutoConfiguration.
* @author lontime
* @since 1.0
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(name = "com.github.lontime.extcopper.CopperInstance")
public class CopperAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public DependencyInjector dependencyInjector() {
return new SpringDependencyInjector();
}
@Bean
public CopperComponentExt copperComponentExt(ObjectProvider dependencyInjector) {
return new CopperComponentExt(dependencyInjector.getIfAvailable());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy