The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mans6singh (17) [Avatar] Offline
#1
Hi:

I need to use aspects with injected references but they are not singleton, and their factory method (aspectOf) will take an argument. How can I accomplish this.

Thanks.
ramnivas (171) [Avatar] Offline
#2
Re: Question about factory method aspectOf
Take a look at @Configurable support described in chapter 16. Either that or a similar approach should work for your case.

-Ramnivas
mans6singh (17) [Avatar] Offline
#3
Re: Question about factory method aspectOf
I saw that but could not figure out where the param for aspectOf is being passed (eg: object for pertarget aspect). Does it have to be explicit/manual ?
ramnivas (171) [Avatar] Offline
#4
Re: Question about factory method aspectOf
You won't need to directly use aspectOf(). With the @Configurable support, whenever an aspect instance is created, it will be injected with the configured dependencies.

If this isn't clear, please describe your use case and show the code you have tried so far.

-Ramnivas