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

com.github.lontime.extspring.configuration.CopperAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
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