Hi Vance, this could be a case for using this. Config keys are known at time of coding stuff. You can build a @Config annotation without bind all possible values by using unique annotation bindings.
The ProvisionListener is introduced in Guice 4, so it's not mine interface and that was the missing part to get Provider injection working (with some ThreadLocal magic). On 20 Aug., 19:00, Vance Maverick <[email protected]> wrote: > Hi -- my attention was drawn to this recently by a colleague. I'm not sure I > understand your use case: it looks like you expect to have object IDs baked > into your code, where more typically (I think) one would write a given > method to work on objects of one type but various IDs. > > In any case, I've been doing something somewhat similar with Guice, which > might interest you or others. There's a binding annotation @Config, which is > used to inject the value of a configuration parameter: > > @Inject > @Config("myConfigParam") > int myValue; > > The injection is done by a ConfigModule, which is initialized with a set of > configuration parameters -- anything that looks like a Map<String, String>. > It doesn't require any extensions to Guice. > > By the way, does your ProvisionListener work correctly for Provider > injection? I experimented with this some, and in the Provider case, I > couldn't figure out how to get at the annotation value (your byId). > > Vance -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
