tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taylor Mathewson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TAP5-799) Overriden Service Injected Into Page via @Inject Loses Decoration
Date Thu, 06 Aug 2009 16:32:15 GMT

    [ https://issues.apache.org/jira/browse/TAP5-799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740138#action_12740138
] 

Taylor Mathewson commented on TAP5-799:
---------------------------------------

So it turns out the workaround above injects the non-overriden but properly decorated service.

I'm going to try using decoration as suggested by Mr. de Paula Figueiredo on Nabble, but as
far as I can tell, service overriding per the "new" way ignores decoration.

> Overriden Service Injected Into Page via @Inject Loses Decoration
> -----------------------------------------------------------------
>
>                 Key: TAP5-799
>                 URL: https://issues.apache.org/jira/browse/TAP5-799
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-ioc
>    Affects Versions: 5.1.0.5
>            Reporter: Taylor Mathewson
>
> I have a Core Module which binds a service impl to an interface, and decorates it (hibernate
transaction decorator, and a couple of custom things)
> I have page beans which reference the service, e.g.:
> @Inject
> private SomeService someService;
> Everything works fine up to this point.
> I add in an Extension Module, which refers to the Core Module as a submodule, and overrides
the service impl, e.g.:
>     public static void contributeServiceOverride(MappedConfiguration<Class, Object>
configuration, ObjectLocator locator) {
>         configuration.add(SomeService.class, locator.proxy(SomeService.class, ExtendedSomeServiceImpl.class));
>     }
> My services all get the right stuff, but the pages get the extended service impl without
any decoration.
> This can be worked around by the following:
> @InjectService("SomeService")
> private SomeService someService; 
> Workaround is cumbersome and loses the elegance of injection by type.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message