Ah I realized that I'm having a start level problem ^^ The bundle that contains the weaver hook impl should be loaded before all other bundles :)
----- Original Message ----- From: [email protected] To: [email protected] Date: 09.07.2012 19:17:51 Subject: Re: Re: AOP in Apache Felix > Hi Marcel, > > here are some examples: > > 1. Looking for special annotations on service methods > > @Authorize > public void executeSomethingOnlyAllowedIfUserIsAuthorized() { > ... > } > > All method that is annotated with @Authorize will be handled with a `before` > aspect which is checking some credentials. > > 2. Default Logging for thrown Exceptions, Bundle start/stop, etc. > > Is it clear what I want to do? > > I'm currently looking how the weaving hooks are working. But if I register an > `WeavingHook` impl and start it with some of my bundles, nothing happens. So > the weave method will not be called :( Do not know what I'm doing wrong. > > WeavingHookImpl Code: > > public class WeavingHookImpl implements WeavingHook { > > @Override > public void weave(WovenClass arg0) { > System.out.println("load class " + arg0.getClassName()); > > } > > } > > Activator Code: > > public class Activator implements BundleActivator { > > @Override > public void start(BundleContext arg0) throws Exception { > System.out.println("start weaving bundle"); > arg0.registerService(WeavingHook.class, new WeavingHookImpl(), null); > } > > @Override > public void stop(BundleContext arg0) throws Exception { > // TODO Auto-generated method stub > > } > > } > > Greetings. > Christian > > ----- Original Message ----- > From: [email protected] > To: [email protected] > Date: 09.07.2012 18:43:27 > Subject: Re: AOP in Apache Felix > > >> Hey Christian, >> >> On Jul 9, 2012, at 15:20 PM, <[email protected]> >> <[email protected]> wrote: >> >>> Hi guys, >>> >>> Currently I'm trying to add AOP support to my Felix OSGi environment. After >>> some research I came up with following possibilities: >>> >>> * using dynamic proxies (Spring AOP or DependencyManager) >>> * Equinox Weaving (but does not work in Apache Felix) >>> >>> All the above solutions doesnt suit my use case. I need aspects which >>> weaves in terms of special annotations. I do not want to know the service >>> interfaces which could be implemented by a proxy like the DependencyManager >>> is doing. Is there any possibility to add "real" AOP support to my project? >> >> So do you want to be able to apply your weaving to any implementation class >> in any bundle? Or do you want to still do it on an interface, just without >> specifying what specific interface(s) you want to apply the weaving to? >> Maybe if you explain your use cases a bit more, we can help you think about >> alternative solutions. >> >> Greetings, Marcel >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

