Hi Am 26.06.2012 um 00:34 schrieb Robert A. Decker:
> Hi, > > I've written an AdapterFactory that appears to be set up correctly. It shows > up in my services and has adaptables and adapters. And when I look under the > System Console 'Sling Adapters' tab it shows up as well with the proper > values under the Adaptable Class column and under the AdapterClass column. > > However, when I adaptTo on a Resource instance to one of my classes I get > null. > > Out of curiosity I tried adapting the Resource instance to a Node instance > and adapting that. However, I get compile time error that I'm unable to > resolve the method adaptTo with my class type. > > I don't get this compile error with Resource or ResourceResolver, but perhaps > that's being resolved by something like the AdapterManager… I'm really not > sure. > > But one thing I'm pretty sure is that no code is ever called in my > AdapterFactory. I'm not sure when the getAdapter method is called normally > but when I put a breakpoint in the method during a bundle install or when I > try to do the apaption my breakpoint is never hit… > > Any ideas? Am I missing a step? Are you sure to not have confused adapter and adaptable in your AdapterFactory ? Your own class would be an adapter and Sling's Resource would be adaptable. Regards Felix
