On Mar 5, 2010, at 1:53 AM, Guillaume Nodet wrote:
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 ?
This strikes me as a bug. After BundleContext.installBundle() returns
the framework must have persistently recorded the installation for
later restarts.
Regards,
Alan
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev