publicinterfaceApplicationContextAwareextendsAware Interface to be implemented by any object that wishes to be notified of the ApplicationContext that it runs in. Implementing thisinterfacemakes sense for example when an object requires access to a set of collaborating beans. Note that configuration via bean references is preferable to implementing thisinterfacejustfor bean lookup purposes. This interfacecan also be implemented if an object needs access to file resources, i.e. wants to call getResource, wants to publish an application event, or requires access to the MessageSource. However, it is preferable to implement the more specific ResourceLoaderAware, ApplicationEventPublisherAware or MessageSourceAware interfacein such a specific scenario. Note that file resource dependencies can also be exposed as bean properties of type Resource, populated via Strings with automatic type conversion by the bean factory. This removes the need for implementing any callback interfacejustfor the purpose of accessing a specific file resource. ApplicationObjectSupport is a convenience base classfor application objects, implementing this interface.
大概意思就是说只要实现了ApplicationContextAware接口的类,期望被告知当前运行的applicationContext是什么。然后又说了如果是想要获取资源最好是用ResourceLoaderAware, ApplicationEventPublisherAware or MessageSourceAware 这几个接口,最后还来了一句我们知道你们要使用这些接口,所以我们帮你弄了一个实现了这些接口的抽象类ApplicationObjectSupport(在spring-context的jar包中)。这里说得很清楚要使用bean的话,实现ApplicationContextAware,因为我们这里不需要使用静态资源之类的所以我们就不用spring为我们提供的ApplicationObjectSupport了,有兴趣的可以自己研究下。