I will try to explain this with an example, hopefully that is the easiest way to understand what i'm aiming at here. I'm still learning Spring, so maybe i'm just missing something obvious here.
Suppose we have a simple Spring application which gets a stream of integers from some source, applies some processing to it (what exactly is user defined), and then sends those processed integers to some sink.
Lets also assume there is some nice web GUI as a frontend where the user can add different processors at will, like addition, subtraction and so on and then for each processors how much for example he would like to add.
How would i apply these changes the user can make to a running Spring application? Especially if these are bigger changes which require removing/adding beans or have bigger consequences for an already running bean?
How would i save and apply these changes when the Spring application starts again?
My intuitive approach would be to have these processors annotated with @Scope("prototype")
and then simply create what beans are used when i receive a change to what processors are there. Changes can theoretically also be handled this way, but that doesn't seem like a good solution at all when the beans take longer to load and not very "springy". Also poses the problem what happens when the user makes fast changes and the beans are not even refreshed when the next changes come in.
Saving is kind of the same boat, i would probably write it to some database and then query that on startup for how the configuration was, but that also feels not very "springy".
Any suggestions appreciated :)
edit: For my actual use case, the processors need to be beans (i think) because i want to able to inject other classes in there.