实现BeanNameAware接口,复写
public void setBeanName(String arg0){}方法,参数arg0是获得正在加载的那个bean的id
实现BeanFactoryAware接口,复写
public void setBeanFactory(BeanFactory arg0) throws BeansException{}方法,就可以获取bean工厂
实现ApplicationContextAware接口,复写
public void setApplicationContext(ApplicationContext arg0) throws BeansException{}方法,就可以获取ApplicationContext