You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Keio Kraaner <Ke...@playtech.com> on 2011/03/22 08:36:33 UTC

overriding a service and gathering its contributions

Hi,



I want to override a service, lets say SomeService, with my own implementation, lets say SomeServiceMyImpl.

In my module class I do it like this:

...

public static void bind(ServiceBinder binder)

{

    binder.bind(SomeService.class, SomeServiceMyImpl.class).withId("SomeServiceMyImpl");

}



public static void contributeServiceOverride (

MappedConfiguration<Class, Object> configuration,

       @InjectService ("SomeServiceMyImpl") SomeService someServiceMyImpl)

{

       configuration.add(ComponentClassResolver.class, someServiceMyImpl);

}

...

The problem is that contributions for SomeService (in the format contributeSomeService(...)) are not gathered and injected into constructor of SomeServiceMyImpl.

Does anybody know how to achieve this?



Regards

Keio Kraaner