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

com.alibaba.cola.boot.SpringBootstrap Maven / Gradle / Ivy

The newest version!
package com.alibaba.cola.boot;

import com.alibaba.cola.common.ApplicationContextHelper;
import com.alibaba.cola.extension.Extension;
import com.alibaba.cola.extension.ExtensionPointI;
import org.springframework.context.ApplicationContext;

import javax.annotation.Resource;
import java.util.Map;

/**
 * SpringBootstrap
 *
 * @author Frank Zhang
 * @date 2020-06-18 7:55 PM
 */
public class SpringBootstrap {

    @Resource
    private ExtensionRegister extensionRegister;

    public void init(){
       ApplicationContext applicationContext =  ApplicationContextHelper.getApplicationContext();
        Map extensionBeans = applicationContext.getBeansWithAnnotation(Extension.class);
        extensionBeans.values().forEach(
                extension -> extensionRegister.doRegistration((ExtensionPointI) extension)
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy