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