Re: [T5.1] How do you advise ClassNameLocator?

2009-05-09 Thread Steve Eynon
You can advise any service defined in Tapestry Core but you can not advise services defined in Tapestry IOC. The TapestryIOCModule is annotated with @PreventServiceDecoration which... does just that! Steve. 2009/5/8 Igor Drobiazko : > Hi Steve, > > that is not true. Of course you can override C

Re: [T5.1] How do you advise ClassNameLocator?

2009-05-07 Thread Igor Drobiazko
Hi Steve, that is not true. Of course you can override ClasspathURLConverter as any service in Tapestry. On Wed, May 6, 2009 at 6:49 PM, Steve Eynon wrote: > Arr, yes, thanks Igor. > > The JavaDocs for ClasspathURLConverter even states it exists for OSGi > (Eclipse) apps: > > > This is a hook f

Re: [T5.1] How do you advise ClassNameLocator?

2009-05-06 Thread Steve Eynon
Arr, yes, thanks Igor. The JavaDocs for ClasspathURLConverter even states it exists for OSGi (Eclipse) apps: > This is a hook for supporting OSGi, allowing "bundleresource" and > "bundleentry" protocols to be converted to "jar:" or "file:". The default implementation currently returns the URLs

Re: [T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Igor Drobiazko
Hi Steve, the problem is the protocol bundleresource. You should override ClasspathURLConverter which is used by ClassNameLocator. This service was introduced to be able to handle URLs which are not common in Java. I provide for example my own implementition of this service in an OSGi environment,

Re: [T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Thiago H. de Paula Figueiredo
Em Wed, 06 May 2009 00:33:34 -0300, Steve Eynon escreveu: The whole TapestryIOCModule is annotated with @PreventServiceDecoration so that explains why I can't override it. Might it be an idea to just annotate individual dangerous services rather than a blanket ban on overriding all IOC servi

Re: [T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Steve Eynon
Thanks. The following gives me the same list of interfaces as advising: @Match("*") public static T decorateEverything(Class serviceInterface, T delegate, String serviceId) { System.out.println(serviceInterface.getName()); return delegate; } ClassNameLocator not being one of them

Re: [T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Thiago H. de Paula Figueiredo
Em Tue, 05 May 2009 19:23:14 -0300, Steve Eynon escreveu: How do I advise the ClassNameLocator service? Have you tried decoration instead of method advising? The resulting code would be very similar. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor

[T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Steve Eynon
How do I advise the ClassNameLocator service? If I add the following advice method to my AppModule ... @Match("*") public static void adviseEverything(MethodAdviceReceiver receiver) { System.out.println(receiver.getInterface()); } Only the following interfaces are advised ... interface