Re: Issues with ServiceOverride and Contributions
This does get to the nature of "what's public, what's private?" That is, I can see how we could provide an @ConfigurationFor("ComponentClassResolver") annotation that would grab the configuration for some other service, but that leaves me a little chilled in terms of implementation privacy. Perhaps Tapestry IoC needs a bonified "override" method prefix for modules? An easiler solution is to use decoration, and to change the ComponentClassResolver API to provide the data you need! On Fri, Mar 27, 2009 at 8:03 AM, Thiago H. de Paula Figueiredo wrote: > On Fri, Mar 27, 2009 at 11:31 AM, Ben Gidley wrote: >> 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 agree that this is a Tapestry IoC limitation. Please post a JIRA > about this so the committers can do something about it. :) > > -- > Thiago > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Issues with ServiceOverride and Contributions
On Fri, Mar 27, 2009 at 11:31 AM, Ben Gidley wrote: > 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 agree that this is a Tapestry IoC limitation. Please post a JIRA about this so the committers can do something about it. :) -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Issues with ServiceOverride and Contributions
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" > To: "Tapestry users" > 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 > >
Re: Issues with ServiceOverride and Contributions
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" To: "Tapestry users" 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
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