package com.siginfo.common;

import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

public final class AppUtils {
	    private AppUtils() {
	    }

	    public static Object getBean(Class<?> classType) {
	        ApplicationContext applicationContext = ApplicationContextProvider.getApplicationContext();
	        return applicationContext.getBean(classType);
	    }

	    public static Object getBean(String beanName) {
	        ApplicationContext applicationContext = ApplicationContextProvider.getApplicationContext();
	        return applicationContext.getBean(beanName);
	    }

	    public static ApplicationContext getApplicationContext() {
	        return ApplicationContextProvider.getApplicationContext();
	    }

	    public static String getApplicationId() {
	        return ApplicationContextProvider.getApplicationId();
	    }

	    public static Environment getApplicationEnvironment() {
	        return ApplicationContextProvider.getApplicationEnvironment();
	    }
}

