The location is an opaque string. Think of it as a secondary key for the 
bundle. Bundle id being the primary key. The only requirement is that each 
bundle installed in the framework must have a unique location string.

That said, it is very common for location strings to be URLs to the actual 
bundle. So if one does 
context.installBundle("http://some.server.com/somebundle.jar";) the 
framework will create an inputstream to read the bundle from the URL. But 
if you are installing from an inputstream you created, the location string 
can have any unique value. Also, note that bundle.update() will only work 
if the location is a URL to the bundle. Otherwise you will need to use the 
bundle.update(InputStream) method and specify the inputstream from which 
to update the bundle.

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
[EMAIL PROTECTED]

office: +1 386 848 1781
mobile: +1 386 848 3788




"ich bin" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
02/24/2007 08:49 AM
Please respond to
OSGi Developer Mail List <[email protected]>


To
OSGi Developer Mail List <[email protected]>
cc

Subject
Re: [osgi-dev] Mapping services across multiple OSGi platforms






Hi,

> Not sure what you mean by "the OSGi directory"?? 
> OSGi doesn't really require a file system, and AFAIK no such term exist 
at
> the 
> specification level. However, BundleContext.getDataFile() returns you a
> file 
> handle to a file which is in scoped by the bundle. Where this is, is up 
to
> the framework implementation, and you can't make any further assumptions
> on 
> where other stuff is.

I would like to install and start an OSGi bundle from an InputStream. And 
I wrote lines of code like that:
...................
Bundle bundle = context.installBundle(String location, inputStream);
inputStream.close();
bundle.start();

However, I do not know which value I should pass for the first parameter, 
location , of the funtion installBundle() . Be aware that I assume that I 
do not know in advance where root directory of OSGi is allocated in the 
file system. How can it be done?

Could anyone give me a tip?

Regards,
Conan.
-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev


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

Reply via email to