package com.artfess.base.dataway;

import net.hasor.dataway.DatawayService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * @author 陈实
 * @Package com.sysplat.dataway
 * @date 2020/12/10 16:00
 * @Description:
 */
@Component
public class DatawaySpringUtil implements ApplicationContextAware, DisposableBean {
    /**
     * 上下文对象实例
     */
    private static ApplicationContext applicationContext = null;

    private static DatawayService datawayService;

    public static DatawayService getDatawayService() {
        return datawayService;
    }

    public static void setDatawayService(DatawayService datawayService) {
        DatawaySpringUtil.datawayService = datawayService;
    }


    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        DatawaySpringUtil.applicationContext = applicationContext;
    }

    @Override
    public void destroy() throws Exception {

    }
}
