That reminds me of a problem I've hit recently, for which I'd be
interested to have more information on.
When you install a bundle, the information must be persisted by the
framework so that it will still be installed when you *restart* the
framework.
Now my question, is what means *restart* ?
If the framework is nicely shutdown (using systemBundle.stop() for
example), then restarted, I assume it must work.
Now, what if the process is abruptly killed or if
java.lang.Runtime.halt() is called after returning from the call ?
I've had the problem because equinox actually persists the system
changes asynchronously. Unfortunately if another bundle persists some
information using
BundleContext#getDataFile()
things can become out of sync.
For example, consider the following bundle activator:
public void start(BundleContext context) throws Exception
{
String location = "http://host/bundle.jar";
File persist = bundleContext.getDataFile("installed");
if (!persist.exists()) {
bundleContext.installBundle(location);
OutputStream os = new FileOutputStream(persist);
os.write(location.getBytes());
os.close();
}
}
Consider that as a dummy initial provisioning system.
Now, your hope would be that if the installed file exists, the bundle
is installed, right ? Unfortunately, there's no guarantee around
that.
Actually, I think Felix guarantee that, but Equinox does not, and if
you kill the process right after the activator has been called, upon
restart, the bundle will not be installed anymore.
Is that an expected behavior ? Thoughts ?
On Thu, Mar 4, 2010 at 12:27, Neil Bartlett <[email protected]> wrote:
> David,
>
> That is the default behaviour of OSGi: bundles remain installed and in
> the same state across restarts of the framework. The way your
> framework is launched should have no effect on this behaviour.
>
> Neil
>
> On Thu, Mar 4, 2010 at 11:20 AM, David Conde <[email protected]> wrote:
>> Hi,
>>
>>
>>
>> I would like to know if there is any OSGI launcher which allow to remain
>> installed after being shut down these bundles which were installed by
>> programming but were not included in the installation folders of the
>> launchers. Is there any launcher which allow me to install bundles using
>> BundleContext and I can have these installed bundles after shut down the
>> launcher?
>>
>>
>>
>> Thank you in advance
>>
>>
>>
>> David
>>
>> _______________________________________________
>> OSGi Developer Mail List
>> [email protected]
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev