[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] How to use exttension bundle and adaptor hooks?

I have make an extension bundle to hook the process of OSGi classloading. I have read the article at http://wiki.eclipse.org/index.php/Adaptor_Hooks and do a demo following the guide step by step. It works fine in eclipse ide, but doesn't work out of ide. I can't understand why?
The command line used out of ide is
"java -Dosgi.framework.extensions=org.eclipse.equinox.examples.simpleloaderhook -jar org.eclipse.osgi_3.3.0.jar -console -clean"
And in eclipse ide, no special arguments are set.
" -Dosgi.framework.extensions=org.eclipse.equinox.examples.simpleloaderhook".
I have traced the code of org.eclipse.osgi, and found the classloader of system bundle can't load the resource of org.eclipse.equinox.examples.simpleloaderhook. But in IDE, it works.
The code in org.eclipse.osgi.
hookConfigurators = cl != null ? cl.getResources(HookRegistry.HOOK_CONFIGURATORS_FILE) : ClassLoader.getSystemResources(HookRegistry.HOOK_CONFIGURATORS_FILE);
Can any one help me?
Tony Wang