I'm working on an OSGi bundle which implements a service as a wrapper around a native executable. That is, the service runs the executable with ProcessBuilder
, feeds it some data, and retrieves the result. My question is about the best way to package this bundle. The native executable includes a number of dependent data files which all must be present on disk for the tool to run. I've found plenty of references on dealing with native DLLs in OSGi, but none that address files associated with a bundle that must be present on disk rather than just retrievable through the classpath.
I was thinking that I could include the exectuable and dependent files directly in the bundle archive and then programmatically extract to some directory when the bundle is started. The other option I can think of is to put the executable somewhere and set a system property that points to it or something, but I want to keep configuration to a minimum.
A solution that isn't specific to a particular OSGi implementation would be nice, but if not, I'm using Equinox.
Thanks!