0

I am developing a series of grails plugins that need to register themselves with the application when it starts. This would allow me to create a factory to lookup plugin class instances by a friendly string name at runtime.

What would be the best approach for storage of this data globally within the grails application?

cweston
  • 11,297
  • 19
  • 82
  • 107

1 Answers1

0

Have a look at GrailsPluginManager which eventually does that for you. Something like below in BootStrap will be feasible:

grailsApplication.mainContext.getBean('pluginManager').allPlugins.each{ plugin->
    println "Plugin Info ${plugin.name} - ${plugin.version}"
}

or just

pluginManager.getGrailsPluginForClassName("FooPlugin")

if you already have the bean accessible.

dmahapatro
  • 49,365
  • 7
  • 88
  • 117