Consider this as the equivalent of GenericXmlApplicationContext for
Groovy bean definitions, or even an upgrade thereof since it seamlessly understands
XML bean definition files as well. The main difference is that, within a Groovy
script, the context can be used with an inline bean definition closure as follows:
With the following Java code creating the GenericGroovyApplicationContext
(potentially using Ant-style '*'/'**' location patterns):
GenericGroovyApplicationContext context = new GenericGroovyApplicationContext();
Or even more concise, provided that no extra configuration is needed:
ApplicationContext context = new GenericGroovyApplicationContext("org/myapp/applicationContext.groovy");
This application context also understands XML bean definition files,
allowing for seamless mixing and matching with Groovy bean definition files.
".xml" files will be parsed as XML content; all other kinds of resources will
be parsed as Groovy scripts.