I just though I would clarify that these are run time modules that have nothing to do with the existing CDI concept of modules (I probably need a better name for them).
Basically these will just provide a dynamic way for you to vary the implementation of a bean at runtime.
Don't let me stop you but what it the difference to keeping the logic in a @Produces? Fewer evaluations? Something else? Or am I missing the problem?
It sounds like the
activitiesstuff that we used to have in older drafts of the CDI spec. I encourage you to take a look at that stuff and see what you think. Unfortunately, I'm not sure that there's a way to implement this stuff properly as a portable extension (which is why we thought we needed it in the spec).
I think Weld has some support for activities already, perhaps you could look into working on that stuff (if it still exists), since activities could definitely make a comeback in a future rev of CDI, if we have a working implementation to use as a starting point.
Do you know where I could find one? I had a look on the JSR site and could not seem to find the draft with activities in it.