The comment was more directed as Marcel ;-) Service hooks are new in OSGi Core 4.2 and can be used to have a closer interaction with the service engine. Use cases as depicted in the core spec includes: * service proxying * providing services on demand
So what Marcel did falls exactly into this category. Service hooks can be used to completely hide the original service and provide a proxied service instead (where you can then perform anything you want). Note that this is a very low level tool provided by the OSGi framework. On Wed, Mar 31, 2010 at 11:19, Ivanhoe Abrahams <[email protected]>wrote: > Hi Guillaume > > Can you give more information on service hooks? Is this something new or > are > you talking about ServiceTracker stuff? > > thnks > Ivanhoe > > > On Wed, Mar 31, 2010 at 11:12 AM, Guillaume Nodet <[email protected]> > wrote: > > > Wouldn't it make more sense to use service hooks instead ? > > The current design is limited as if a user wants to grab the list of > > services and use those, that would not work. > > > > On Wed, Mar 31, 2010 at 11:06, Marcel Offermans < > > [email protected] > > > wrote: > > > > > On Mar 31, 2010, at 11:02 , Ivanhoe Abrahams wrote: > > > > > > > This is helpful in getting me pointing in the right direction. > > > > So just to recap. > > > > > > > > Option 1 in your email is the traditional approach where you have aop > > > > pointcuts, etc. defined > > > > Option 2 is intercepting the calls and dynamically weaves in > > > > code...something akin to asm bytecode weaving? > > > > > > It does not do bytecode weaving at all, it relies on the fact that > > services > > > have a service ranking, so the aspect simply publishes a service with > all > > > the same properties as the original one, but a higher ranking. Clients > > will > > > automatically pick the service with the highest ranking. So there's no > > > bytecode weaving at all (which makes debugging a lot easier, since your > > code > > > still looks exactly like you wrote it). > > > > > > Greetings, Marcel > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > > > > > > -- > > Cheers, > > Guillaume Nodet > > ------------------------ > > Blog: http://gnodet.blogspot.com/ > > ------------------------ > > Open Source SOA > > http://fusesource.com > > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com

