Hi Kabir,
I just implemented something like this for the OSGi performance benchmarks. Here's a quick description of the bundle dependency topology that it creates:
5 (Versioned) Common Bundles
- Exports org.jboss.osgi.test.common;version=x
5 Numbered (but not versioned) Util Bundles
- Imports org.jboss.osgi.test.common
- Exports org.jboss.osgi.test.util[x];uses="org.jboss.osgi.test.common"
5 Versioned Interfaces Bundles
- Exports org.jboss.osgi.test.versioned;version=x
5 Versioned Impl Bundles
- Imports org.jboss.osgi.test.common;version=[x,x]
- Imports org.jboss.osgi.test.versioned;version=[x,x]
- Imports org.jboss.osgi.test.util[x]
- Exports org.jboss.osgi.test.versioned.impl;version=x;uses=org.jboss.osgi.test.util[x]
a large number of test bundles (number configurable)
- Imports org.jboss.osgi.test.common;version=[x,x]
- Imports org.jboss.osgi.test.versioned;version=[x,x]
- Imports org.jboss.osgi.test.versioned.impl;version=[x,x]
Where x is a number [1..5].
Each test bundle loads a class of each of its 3 dependency packages in its activator. This also triggers an indirect load on the Util[x] class.
It's available on master in jbosgi on github: BundleInstallAndStartBenchmark.java
You might be able to reuse some of this...
David