Passing the "binding annotaion" as a parameter (Dynamic binding)

42 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

royi klein

lukematon,
8.9.2022 klo 11.01.228.9.2022
vastaanottaja google-guice
Hi

I have the following scenarion:

I have a system architectured as "plugins" that are loaded per annotation - an inrerface has multiple implementations that are injected according to an annotations.
Until now - we are OK.

Problem is - those implementations have injections to their private members (usually as inject members and not contructor injection):
I need to be able to inject using the same annotation that was used before but I don't  know in advance what is the "context" here.
Is there a way to get the binding annotation used / pass it as an argument somehow?

Thanks 
Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä