Is it not possible to have my Aspect defined in standalone bundle that is to say seperate from the bundle implementing the service being adviced
Is it not possible to have my Aspect defined in standalone bundle that is to say seperate from the bundle implementing the service being adviced
Are you using AspectJ with load-time weaving or compile-time weaving?
This is definitely possible when compile-time weaving is used: dm Server itself uses a number of aspects that are held in bundles that are separate to those that have been advised.
If you're using load-time weaving then things become significantly more complex. My advice in this case would be to consider using compile-time weaving if possible.
Andy Wilkinson
SpringSource
i am using runtime weaving support provided by spring AOP
Basically i have a Bundle(say BundleA) with service interface ,BundleB implementing the interface
Now i don't want each implementer to have a Aspect defined in there application context ,instead i would prefer to define Aspect in the interface bundle so that all the Bundles which provide implementation are adviced
Ah, ok, you're using Spring AOP: that makes things easier.
When you configure a LoadTimeWeaver bean in your application context, dm Server automatically replaces it with an OSGi-aware load-time weaver implementation: KernelLoadTimeWeaver.
You'll have to make sure that your bundle manifest imports the package(s) that contain your aspect(s).
I would recommend giving this a go and letting us know if you encounter any problems and we'll do what we can to help.
Andy Wilkinson
SpringSource
Hi Andy ,
This did not work either .
Regards
vishal
Ok. What was the failure that you encountered? It's going to be very hard to diagnose the problem without more details on what you were trying to do, and what went wrong. We'll need stack traces, log output, etc.
Andy Wilkinson
SpringSource
Shall i upload my demo bundles ,If it may help
Yes, that may help, but we may be able to identify the problem just from the stack trace of the error (assuming you're getting one) so please let us know what this is too.
Andy Wilkinson
SpringSource
Hi andy ,
I am not getting any Exception as such but my sysouts from the advice
I have attached my Demo
Last edited by vishalj; Oct 26th, 2009 at 12:38 AM.
Thanks, Vishal. Could you attach compiled binaries already in their bundles, please? I'd like to be sure that we're both working against the exact same code.
Andy Wilkinson
SpringSource