Open GoogleCodeExporter opened 9 years ago
FWIW this is my old BindingFactory patch from issue 49 - it still needs
updating to apply cleanly against master, but may be useful as a starting point
for discussion.
Original comment by mccu...@gmail.com
on 28 Oct 2013 at 11:11
Attachments:
How is this different than issue 49?
Original comment by sberlin
on 28 Oct 2013 at 3:25
Not sure, though maybe the use-case is different. Issue 49 was a bit vague to
begin with. I have provided a concrete use-case, with strong demand [1], with
no known workaround.
[1] See the number of votes on https://java.net/jira/browse/JERSEY-1950 (this
is a large number by Jersey standards).
Original comment by cow...@bbs.darktech.org
on 28 Oct 2013 at 3:37
Another approach (which doesn't seem to be covered by issue 49) is to extend
TypeListener to cover constructor injection. If TypeListener were fired for
DepartmentsResource I could register the equivalent of MemberInjector for the
constructor parameters.
Original comment by cow...@bbs.darktech.org
on 28 Oct 2013 at 7:38
Sam,
Who do we need to bring on board to move this issue forward?
Original comment by cow...@bbs.darktech.org
on 31 Oct 2013 at 9:34
I'm not sure. Is there a reason that Stuart's suggested flow (use a module
that takes other modules and uses the SPI to scan them & write binding
statements for the remaining injection points) won't work for you?
Guice very strongly leans against allowing this kind of autobinding.
Original comment by sberlin
on 31 Oct 2013 at 11:01
I guess I didn't fully understand what he meant. Did he mean I should inject a
Guice Module that takes HK2 DynamicConfiguration as input and convert
DynamicConfiguration bindings into Module bindings?
Guice seems to be geared towards binding a configuration at init time, whereas
HK2 allows bindings to change at runtime. (John Wells, please correct me if I'm
wrong.)
It's not clear to me how I'd add/remove/modify bindings at runtime with Guice,
even if I could register an event listener for HK2's DynamicConfiguration.
Injector.createChildInjector() allows me to add new bindings at runtime, but
it's not clear how to change/remove them at a later time.
I've asked John to provide us with some background information about HK2
because I'm not very familiar with how it work.
Original comment by cow...@bbs.darktech.org
on 1 Nov 2013 at 12:21
HK2 does indeed allow for dynamic additions and removals of underlying
descriptors at any time (given the proper permissions). This ends up being
useful in dynamic systems such as OSGi systems or really any module system
(jigsaw etc). I guess more specific questions would get more specific
answers lol. More information can be found here of course:
https://hk2.java.net/
Original comment by jwells13...@gmail.com
on 3 Dec 2013 at 7:59
Original issue reported on code.google.com by
cow...@bbs.darktech.org
on 28 Oct 2013 at 10:11