tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Klein (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TAP5-1954) ObjectLocator will return wrong service implementation delegate when using markers alone
Date Thu, 07 Jun 2012 22:41:23 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Carsten Klein updated TAP5-1954:
--------------------------------

    Description: 
Having the following services bound using the specified markers

binder.bind(IServiceOne.class, ServiceOneImpl.class).withMarker(ServiceOneMarker.class);
binder.bind(IServiceOne.class, ServiceOneSecondImpl.class).withMarker(ServiceOneSecondMarker.class);

will cause the ObjectLocator service to return the wrong implementation class when doing this

objectLocator.getService(IServiceOne.class, ServiceOneSecondMarker.class);

This will return an instance of ServiceOneImpl instead of ServiceOneSecondImpl, although the
marker ServiceOneSecondMarker was never registered with the ServiceOneImpl class.

As a workaround, one must use withId(...) when binding the service interface implementation
classes. In that case, the object locator will return the correct implementation class.


  was:
Having the following services bound using the specified markers

binder.bind(IServiceOne.class, ServiceOneImpl.class).withMarker(ServiceOneMarker.class);
binder.bind(IServiceOne.class, ServiceOneSecondImpl.class).withMarker(ServiceOneSecondMarker.class);

will cause the ObjectLocator service to return the wrong implementation class when doing this

objectLocator.getService(IServiceOne.class, ServiceOneSecondMarker.class);

This will return an instance of ServiceOneImpl instead of ServiceOneSecondImpl, although the
marker ServiceOneSecondMarker was never registered with the ServiceOneImpl class.



    
> ObjectLocator will return wrong service implementation delegate when using markers alone
> ----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1954
>                 URL: https://issues.apache.org/jira/browse/TAP5-1954
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-ioc
>    Affects Versions: 5.3.3
>            Reporter: Carsten Klein
>
> Having the following services bound using the specified markers
> binder.bind(IServiceOne.class, ServiceOneImpl.class).withMarker(ServiceOneMarker.class);
> binder.bind(IServiceOne.class, ServiceOneSecondImpl.class).withMarker(ServiceOneSecondMarker.class);
> will cause the ObjectLocator service to return the wrong implementation class when doing
this
> objectLocator.getService(IServiceOne.class, ServiceOneSecondMarker.class);
> This will return an instance of ServiceOneImpl instead of ServiceOneSecondImpl, although
the marker ServiceOneSecondMarker was never registered with the ServiceOneImpl class.
> As a workaround, one must use withId(...) when binding the service interface implementation
classes. In that case, the object locator will return the correct implementation class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message