It was done with great ease. Adrian performed the following simple steps to successfully integrate the existing application:
- Copied all the spring integration jars into the grails-app/lib directory.
- Copied the existing application's spring config file into the grails-app/resources/spring directory.
- Added a "cafe" property to his Grails service in order to inject the existing application's spring bean.
- Invoked the Cafe interface from the Grails service method.
That was it. To which Rod Johnson commented from the crowd "Can Ruby on Rails do that?"
I'd like to hear from the JRuby and Rails communities. I have to believe there's a way to call an existing spring application bean via a Ruby on Rails app using JRuby. Even if it requires some custom code.
Is it possible? If it isn't simple, are there plans to provide tighter integration to allow organizations to re-use existing spring beans in Rails projects?