Preload a number of beans with prototype scope
My application is using beans with scope prototype.
When the user is connecting, a main context bean is built and all injections are done.
Depending on the number of objects the main context bean had been injected (always the same injection for an application), i can see in my log files that spring loading time is between 200 ms and 3 seconds (when i have a lot of objects in my application).
In my dream, i would have to add a parameter "numberOfObjectsPreloaded" with an int value and objects would be preloaded (in a low priority thread).
By this way, when my users are logged in, they won't have to wait for 3 seconds, we'll just have to give him one of the preloaded bean.
The question is : is it only in my dream ? Is there a way to do it with spring configuration file ?
Thanks for your help.