Provide a way to specify the class loader to be used by a ClassPathXmlApplicationContextFactory [BATCH-2182] #1417
Labels
in: infrastructure
status: declined
Features that we don't intend to implement or Bug reports that are invalid or missing enough details
type: enhancement
Mauro Molinari opened BATCH-2182 and commented
A
ClassPathXmlApplicationContextFactory
createsClassPathXmlApplicationContext
instances. The latter, by extendingDefaultResourceLoader
would allow to specify the class loader to use to locate resources. It would be very useful if the factory and the correspondingClasspathXmlApplicationContextsFactoryBean
(which, IMHO, should better be calledClassPathXmlApplicationContextFactoryFactoryBean
, since it's aFactoryBean
that creates factories and also would need an upper case "P" in "ClassPath") allowed to specify the class loader to use. This would allow to create anAutomaticJobRegistrar
which registers jobs defined in child contexts loaded through a suitable class loader (which may in turn load classes at runtime from hot-deployed JARs, for instance).Being able to specify just one class loader on the FactoryBean for all created factories would be better than nothing.
Right now I have to write my own FactoryBean and factory to achieve this, but I think that supporting this out-of-the-box should be quite simple and valuable.
By the way, I see that with 3.0.0.M2
ClassPathXmlApplicationContextFactory
has been deprecated in favour ofGenericApplicationContextFactory
, which creates genericConfigurableApplicationContexts
. This enhancement might give a reason to revert the deprecation onClassPathXmlApplicationContextFactory
and add some additional value to it...Affects: 2.1.9
The text was updated successfully, but these errors were encountered: