I have a Configuration
annotation, and it is inspected all the way up the injection chain—that is, when a configuration value is requested, the extension checks to see if there is a Configuration
annotation on the parameter itself, the containing method, the containing class, and so on.
But what we really need is a way somehow to investigate the calling stack for such properties/annotations. I think this will have to be a programmatic call (unless I can get complicated with a custom Thread
-based scope). The general hazy ill-conceived idea is that somewhere in the call, you "mark" the current…thread, I guess, as "belonging" to a particular Configuration
(fred
, let's say). Then the configuration framework looks up fred
.whatever-the-value-name-is
.
It would be really cool if we could capture this with annotations (maybe the extension could introspect every bean in the system and somehow detect where this context was set?).