i want to start an OSGI bundle if some informations about this bundle are right , else the bundle must be in the RESOLVED state.
for doing that , i developed an aspect wich contains a pointcut ( with a joinPoint = execution of the start method of the bundle) and an Around advice : i used proceed() if the informations about the bundle are corrects, However i always get the bundle in active state.
I need a little more background on what you are trying to do before I can really answer.
Is your aspect in the same bundle that it is trying to control? Or is it external?
Are you trying LTW or CTW?
If the aspect is internal to the bundle, then you will need to use compile time weaving, but if external, then you will need load time weaving (but not just any load time weaving, you will need to use Equinox Weaving).
I installed AJDT in eclipse galileo , and i tried to integrate Aspectj
with spring and worked with load-time_weaving .I developped
2 separate OSGI bundle (my aspect is external) . I imported aspectjrt.jar and aspectjweaver and it doesn't work.
You need to use Equinox weaving because standard load time weaving does not work in an OSGi environment. Since OSGi uses separate classloaders for each bundle you need to associate a weaver with each bundle. This can be done quite easily by including the Equinox weaving bundles as well as the AspectJ bundles in your project and augmenting your manifests for your aspect bundles. A quick start guide is here: