简体   繁体   中英

Spring Application Context Switch at Runtime

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM