I am trying to register a bean in my plugin, but the class(implementation) of that bean is configurable.
in my TestGrailsPlugin.groovy file:
def doWithSpring = {
userListener("${ConfigurationHolder.config.userListenerClass}")
}
but this is not working! what should I do, I guess should be really easy task. but didnt find anywhere!
cheers
You can load the class dynamically with the
GrailsApplication‘s classloader:Also note that I’m using
application.configinstead of using the holder class – the holders are deprecated in 2.0 and will be removed in a future release.