Could anyone familiar with the code tell me why getDataFile() always returns null for system bundle context? It seems out of the two constructors of BundleImpl, the one that's used by SystemBundle does not initialize bundleDir field. Is this a bug or is there a particular reason for this behavior?
Thanks
Sahoo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reasons are historical, at first there were no System Bundle & Context. Then the System Bundle was introduced but not the System Bundle Context, so we didn't need to initialize the bundle data directory since it wasn't referenced. Then came System Bundle Context, but since we didn't use the system bundle data directory, nobody noticed that it wasn't initialized.
What do you want to use this to? Or is it just that you expect it to return an object on a system with a filesystem? It is legal to return null if we don't have file storage.
/Jan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I don't know why I never got notified of your response. I am again trying using Knopflerfish with GlassFish. Since our launcher code can't be a bundle itself (remember it launches the framework), it uses systemBundle.getBundleContext.getDataFile to obtain a storage area to some information for use in subsequent restart.
Sahoo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This has now been fixed on the trunk.
Download a snapshot build made today (or later) to test it.
Snapshot builds are available on http://www.knopflerfish.org/snapshots/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could anyone familiar with the code tell me why getDataFile() always returns null for system bundle context? It seems out of the two constructors of BundleImpl, the one that's used by SystemBundle does not initialize bundleDir field. Is this a bug or is there a particular reason for this behavior?
Thanks
Sahoo
The reasons are historical, at first there were no System Bundle & Context. Then the System Bundle was introduced but not the System Bundle Context, so we didn't need to initialize the bundle data directory since it wasn't referenced. Then came System Bundle Context, but since we didn't use the system bundle data directory, nobody noticed that it wasn't initialized.
What do you want to use this to? Or is it just that you expect it to return an object on a system with a filesystem? It is legal to return null if we don't have file storage.
/Jan
Hi,
I don't know why I never got notified of your response. I am again trying using Knopflerfish with GlassFish. Since our launcher code can't be a bundle itself (remember it launches the framework), it uses systemBundle.getBundleContext.getDataFile to obtain a storage area to some information for use in subsequent restart.
Sahoo
Okay, that seems to be a valid use for the System Bundle data storage. I'll put that in the next release of the framework.
/Jan
This has now been fixed on the trunk.
Download a snapshot build made today (or later) to test it.
Snapshot builds are available on
http://www.knopflerfish.org/snapshots/