Re: Parameterized service injection

Andrus Adamchik <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <[email protected]>
Ah, good point. This might work. Let me see if I can properly bridge / generate service IDs from Guice to Tapestry. 

Thanks,
Andrus

> On Dec 15, 2016, at 8:04 PM, Lance Java <[email protected]> wrote:
> 
> You should be able to use @InjectService assuming each has a unique id.
> 
>  @InjectService("s1")
>  private MyService<MyType1> s1;
> 
>  @InjectService("s2")
>  private MyService<MyType2> s2;
> 
> 
> 
> On 13 Dec 2016 7:31 a.m., "Andrus Adamchik" <[email protected]> wrote:
> 
>> From what I gather Tapestry 5.4 still does not support parameterized
>> service injection? E.g. in the following example both s1 and s2 will map to
>> the same DI key of the bare class:
>> 
>>  @Inject
>>  private MyService<MyType1> s1;
>> 
>>  @Inject
>>  private MyService<MyType2> s2;
>> 
>> I am running Tapestry on a Bootique.io stack with underlying injection
>> bridged to Google Guice, that supports the above style. So I am a bit
>> crippled by this limitation. I may (or may not :)) have time to develop and
>> contribute this functionality to Tapestry, but before I start digging any
>> deeper, wanted to check whether this is already in the works (or perhaps I
>> overlooked something obvious, and I simply need to revise my Guice to
>> tapestry bridge)?
>> 
>> Thanks for any insight.
>> 
>> Andrus
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.