Let's say that I've got a BarService under grails-app/services and regular Groovy class 'Foo' like this under src/groovy.
class Foo {
def barService
}
Are there any way to turn this into a Spring bean programmatically at runtime? Just to clarify, I want to get a reference to BarService injected into the barService field.
def fooInstance = new Foo()
magic-create-spring-bean-function(fooInstance)
assert fooInstance.barService