Spring4 - ApplicationContextAware、BeanNameAware
・BeanFactory - BeanFactoryを取得する
・ApplicationContextAware - ApplicationContextを取得する
・BeanNameAware - BeanのIDを取得する
ApplicationContextAwareサンプル
package app.aware; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; public class Person implements ApplicationContextAware{ private ApplicationContext context; @Override public void setApplicationContext(ApplicationContext context) throws BeansException { this.context = context; } }