-
1. Re: Howto Inject a DynamicProxy
alesj Feb 12, 2013 7:10 PM (in response to antoen)What about simply using @Produces?
-
2. Re: Howto Inject a DynamicProxy
antoen Feb 12, 2013 7:25 PM (in response to alesj)I fear its not that easy. (Or I do not fully understand your answer)
I (provider of the api) do not know the interface the user of the api will write.
So I can not provide a producer for the user.
The user could write a producer, but he would have to write one for each interface (with annotations of our api) he is going to create.
And he would have to write the boilerplate in that producer. But thats what I want to get rid of.
Best regards,
Anton
-
3. Re: Howto Inject a DynamicProxy
alesj Feb 13, 2013 2:11 AM (in response to antoen)Hmmm, true.
Unless you do extra scanning, to know which interrfaces are missing its matching CDI beans, imo, it cannot work.
I guess you could write an extension which would track injecton points,
and add Bean for each missing interface with @Inject.
Where this bean would be your generic proxy.
-
4. Re: Howto Inject a DynamicProxy
antoen Feb 13, 2013 4:03 AM (in response to alesj)Hi Justin,
thanks for your reply, but thats exactly the question I have.
But I would need some help to solve this.
When I get it right you suggest two possible solutions:
Solution 1) Extra scanning
Do some extra scanning and create the missing beans on the fly.
But I dont know how to trigger the extra scanning, so that I am not too late creating the beans so that weld will register them.
Btw for non CDI Platforms we already do this extra scanning, but we do it lazy and I dont know where to hook into weld.
Or is ther no too late and I can register this (handmade) beans manually with the BeansManager? (But triggered by which event?)
Solution 2) Tracking injection points
Here I have pretty much the same problems. I dont know where to hook into WELD to
a) track the injection points
b) register the handmade beans
Do you have any hint where I could start with?
Best regards,
Anton
-
5. Re: Howto Inject a DynamicProxy
alesj Feb 13, 2013 4:50 AM (in response to antoen)Do you have any hint where I could start with?
By reading the docs / manual on CDI extensions? ;-)
Once you do that, we can get back to more details,
if you still don't see where I'm aiming at.