Re: Service binding based on condition

2017-08-11 Thread Nathan Quirynen
Hey thanks Pavel for your answer, I need only one of the implementations to be injected everytime when injecting "SomeServiceInterface" and don't want to decide when injecting the service, so I don't think this would work for my use case. I went with the service builder method as Thiago

Re: Service binding based on condition

2017-08-11 Thread Nathan Quirynen
Thanks Thiago, this is what I needed. Op 10/08/2017 om 23:10 schreef Thiago H. de Paula Figueiredo: On Thu, Aug 10, 2017 at 12:44 PM, Nathan Quirynen < nat...@pensionarchitects.be> wrote: Hi, Hi! When having just one implementation of a service interface the binding is done like the

Re: Service binding based on condition

2017-08-10 Thread Thiago H. de Paula Figueiredo
On Thu, Aug 10, 2017 at 12:44 PM, Nathan Quirynen < nat...@pensionarchitects.be> wrote: > Hi, > Hi! > > When having just one implementation of a service interface the binding is > done like the following: > > public static void bind(ServiceBinder binder) { >

Re: Service binding based on condition

2017-08-10 Thread Charles Roth
"Read The Friendly Manual" :-) http://tapestry.apache.org/defining-tapestry-ioc-services.html, look for the "Service Ids" section. On 8/10/2017 12:38 PM, Pavel Chernyak wrote: Hi there. public static void bind(ServiceBinder binder) { binder.bind(SomeServiceInterface.class,

Re: Service binding based on condition

2017-08-10 Thread Pavel Chernyak
Hi there. public static void bind(ServiceBinder binder) { binder.bind(SomeServiceInterface.class, SomeServiceImpl.class).withId("someId"); } And in @inject annotation you will require to specify "someId" as name. On 10 August 2017 at 18:44, Nathan Quirynen

Service binding based on condition

2017-08-10 Thread Nathan Quirynen
Hi, When having just one implementation of a service interface the binding is done like the following: public static void bind(ServiceBinder binder) { binder.bind(SomeServiceInterface.class, SomeServiceImpl.class); } But now I need to bind the interface to one of multiple possible