简体   繁体   中英

Lookup Groovy Beans in App Context

I have several Groovy beans defined within my app context file, like so:

<lang:groovy id="bean1">
   ...
</lang:groovy>

I would like to get a list of all the groovy beans from the ApplicationContext , but don't see a clean way to do this.

Is there a straightforward way to get a list of all the Groovy implemented beans?

I am using Spring 3.

applicationContext.getBeansForType(Class.forName("groovy.lang.GroovyObject"));

请参阅ListableBeanFactory Javadoc。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM