class SpringBeanFactory implements ApplicationContextAware {

	// Spring应用上下文环境
    private static ApplicationContext applicationContext;
    
    /**
     * 实现ApplicationContextAware接口的回调方法，设置上下文环境
     */
    @Override
    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
    	SpringBeanFactory.applicationContext = applicationContext;
    }

    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    /**
     * 获取对象 这里重写了bean方法，起主要作用
     */
    public static  <T> T getBean(String beanId) throws BeansException {<FILL_FUNCTION_BODY>}

    /**
     * 获取当前环境
     */
    public static String getActiveProfile() {
        return applicationContext.getEnvironment().getActiveProfiles()[0];
    }

}

        if (applicationContext == null) {
            return null;
        }
        return (T) applicationContext.getBean(beanId);
    
<no_super_class>