Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Hook into System.loadLibrary or Bundle.findEntry
Hook into System.loadLibrary or Bundle.findEntry [message #510981] Fri, 29 January 2010 12:34 Go to next message
Philipp Kursawe is currently offline Philipp Kursawe
Messages: 135
Registered: July 2009
Senior Member
Hello,

is it possible to hook into the way Equinox loads native libraries? I
think it would be enough for me to hook into the find of the native
library. I would also not like to use hooks, that I have to specify at
the command line but rather one that I could add to the framework during
runtime.

Thanks,
Phil
Re: Hook into System.loadLibrary or Bundle.findEntry [message #511063 is a reply to message #510981] Fri, 29 January 2010 16:39 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas Watson
Messages: 435
Registered: July 2009
Senior Member
There are hooks in Equinox for this:

org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook.findLibr ary(BaseData, String) lets you find a requested library path

org.eclipse.osgi.baseadaptor.hooks.BundleFileWrapperFactoryH ook.wrapBundleFile(BundleFile, Object, BaseData, boolean) lets you wrapper a BundleFile and intercept calls to BundleFile.getEntry which are called when Bundle.findEntries is called.

But I am not sure I understand your statement "I would also not like to use hooks, that I have to specify at the command line but rather one that I could add to the framework during runtime."

If you have a framework extension that contains hook implementations (has a hookconfigurators.properties file) then p2 will install and configure it into the framework automatically. There should be no need to add an command line options.

Tom.
Re: Hook into System.loadLibrary or Bundle.findEntry [message #511199 is a reply to message #511063] Sat, 30 January 2010 22:55 Go to previous message
Philipp Kursawe is currently offline Philipp Kursawe
Messages: 135
Registered: July 2009
Senior Member
Thanks Tom for your swift response,

> But I am not sure I understand your statement "I would also not like to
> use hooks, that I have to specify at the command line but rather one
> that I could add to the framework during runtime."
It means that I would not like to specify command line params to get the
hook activated. Thats what I would need to do, as I read on the hooks
wiki page.
>
> If you have a framework extension that contains hook implementations
> (has a hookconfigurators.properties file) then p2 will install and
> configure it into the framework automatically. There should be no need
> to add an command line options.
And what if I will not use p2? Could I also not simply use a fragement
bundle for the system bundle and implement my hook there?

Phil
Previous Topic:JNI UnsatisfiedLinkError for native function of inner class that works in non-OSGi environment
Next Topic:P2: How installing MSI files using p2
Goto Forum:
  


Current Time: Tue Oct 21 12:11:56 GMT 2014

Powered by FUDForum. Page generated in 0.15292 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software