On 13/11/2007, Xi Jiarong <[EMAIL PROTECTED]> wrote: > > Are there any easy way to share image(located in one bundle) between two > different bundles? > I know I can achieve this via service register, but are there any other > easier way to achieve this goal too? > well you can access other bundles via your current bundle context:
http://www2.osgi.org/javadoc/r4/org/osgi/framework/BundleContext.html#getBundles() and from those you can query resources by name (uses the bundle classloader) or by its path inside the bundle: http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html#getResource(java.lang.String) http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html#getEntry(java.lang.String) some projects have written their own resource loaders that build on top of the basic OSGi mechanism: http://springframework.svn.sourceforge.net/svnroot/springframework/spring-osgi/trunk/io > Thanks a lot! > > > Best Regards! > > ---------------- > Jerry > > _______________________________________________ > OSGi Developer Mail List > [email protected] > http://www2.osgi.org/mailman/listinfo/osgi-dev > -- Cheers, Stuart
_______________________________________________ OSGi Developer Mail List [email protected] http://www2.osgi.org/mailman/listinfo/osgi-dev
