Unfortunately in this instance I can't decorate the service and implement
what I want as it isn't going to be possible to decorate it without access
to the configuration. I have tried using decorate but it doesn't let me get
access to the default implementation's constructor.
The reason this is such a problem in this case is the configuration includes
all the packages for all the modules loaded on the classpath. This is
processed entirely in the constructor of the default implementation and
then discarded. Therefore I can't find a way to extract it from the original
service.

This is a bit of a flaw in overriding services in tapestry-ioc - as without
the originals configuration it can be nearly impossible to wrap the service.
For now I have cheated by modifying the tapestry one and doing a custom
build.


Ben Gidley

www.gidley.co.uk
b...@gidley.co.uk


On Fri, Mar 27, 2009 at 1:58 PM, Peter Stavrinides <
p.stavrini...@albourne.com> wrote:

> Hi Ben,
>
> If you want to provide some extensions / overrides some of the logic but
> keep the basics in place then I think you might try decorate the service
> instead. This page provides some good insight, take a look at the section
> "Decorating the RequestExceptionHandler":
> http://tapestry.formos.com/nightly/tapestry5/cookbook/exceptions.html
>
> regards,
> Peter
>
> ----- Original Message -----
> From: "Ben Gidley" <b...@gidley.co.uk>
> To: "Tapestry users" <users@tapestry.apache.org>
> Sent: Wednesday, 25 March, 2009 13:08:17 GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> Subject: Issues with ServiceOverride and Contributions
>
> Hi,
> I am trying to override
> the org.apache.tapestry5.internal.services.ComponentClassResolverImpl
> service
> as per
> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html
> .
> However have hit what appears to be major road block.
>
> My replacement service can implement the interface and is used - however I
> don't seem to be able to get access to the contributions to the service I
> am
> overriding . In this case that is pretty fatal as it loses all the library
> mappings from the various modules in tapestry. This prevents pretty much
> anything working.
>
> To try and 'fix this' I have thought of
>
>   - Getting the original service and then getting the data from it - this
>   doesn't work as the data is all private.
>   - Getting the configuration direct from the registry - but I can't find
>   any way of accessing another services configuration
>   - Using method advice to grab the constructor variable  - however I
>   couldn't get this to work.
>
> Has anyone got any suggestions?
>
>
> Ben Gidley
>
> www.gidley.co.uk
> b...@gidley.co.uk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to