I am using the dynamic language support in spring for Groovy to setup a groovy class that implements one of my interfaces in a .groovy file. In the spring docs the recommended approach to configure a dynamic language bean is in the XML as follows:
<lang:groovy id="messenger" script-source="classpath:Messenger.groovy">
<lang:property name="message" value="I Can Do The Frug" />
</lang:groovy>
I can get this to work, but I was wondering is there a way to configure a dynamic language bean through annotation instead of through XML. The scenario I am thinking of is if I created a new class implementation for an interface that is currently not configured in the XML. I would have to stop the container in order to add the entry to the spring XML. This defeats the purpose of dynamic language support in that I want to be able to hot deploy the new service implementation.
So, my question is, is there an equivalent annotation approach to configure lang:groovy as shown above in XML that I can include in my .groovy file or elsewhere that will force spring to scan and compile the .groovy file?