DataSource.groovy appears to be evaluated before BootStrap.groovy. But, I need to setup something up so that I can invoke some static methods in DataSource.groovy (my database setup is complex).
More Info:
If I was doing this up without Grails, I would probably create a DataSourceFactory Spring Bean. I would then declare dependencies between this bean and other code such that I could explicitly control when everything was initialized. Within my DataSourceFactory class’ PostConstruct method, I would execute the code needed to call my company’s property/configuration framework to get the necessary DB connection information.
So, what I’m looking for is complete (or at least more) programatic control over how the JDBC DataSource is constructed.
DataSource.groovyis evaluated as an executable groovy file. Why don’t you just call your methods right at the start? For example: