I need that to start a separate JVM running an OSGi framework (and get
my bundles installed there). I understand that this will change between
implementations, but on the other hand all 3 open-source ones come as a
single JAR, so I'm reasonably happy with that now. Anyway, I already
need implementation-specific code to install my bundles in there, so I
guess it's ok.
The best way to do that would probably be something like the Equinox
FrameworkAdmin service (http://wiki.eclipse.org/Equinox_FrameworkAdmin
<http://wiki.eclipse.org/Equinox_FrameworkAdmin> ), alas, this is not
standard.
 
Thanks for the CodeSource idea, I think I'll use that.
 
Cheers,
- Olivier

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Watson
Sent: 26 July 2007 16:20
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Retrieving the location of the system bundle



Why do you need the physical location of the system bundle?  This is
going to vary greatly for each framework implementation.  Some
implementations may not be contained in a single jar.  They could be in
some proprietary format or built into the VM.  If they are in a single
jar you could do something like this ... 

BundleContext.class.getProtectionDomain().getCodeSource().getLocation() 

This only tells you the jar or directory that was used to load the
BundleContext class from and only works reliably if the framework was
loaded with a URLClassLoader.   

Tom 
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

Reply via email to