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 Fri, 07 Aug 2009 01:47:15 GMT

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

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

Ok, so using a non-delegating decorator works, although it's a bit brittle to things like
ordering.

It turns out that even the services referencing the overriden serivce interface get the undecorated
override.  At this point it looks like service overrides using the ServiceOverride service
don't get decorated.

> 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