views:

159

answers:

1

Hi,

I'm wondering if it is possible to change which application context your app is using at run time.

The use case would be:

I have a GUI that allows you create queuing networks. It also allows you to select which simulation library you would like to use run the model you've just created. Each library has its own application context which says which castor mapping files to use for translation, how to instantiate beans etc....

How do I tell the system to switch from one context to another?

Any help would be much appreciated.

+1  A: 

Have you looked at using parent and child ApplicationContexts for what you need; where each "simulation library" could be loaded as a child context?

matt b