bug 350785 Support for felix-3.2
This commit is contained in:
parent
5df38f9369
commit
5e94077ba3
|
@ -16,6 +16,7 @@ import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelper;
|
import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelper;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
|
@ -145,8 +146,21 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper
|
||||||
"m_modules");
|
"m_modules");
|
||||||
Felix_BundleImpl_m_modules_field.setAccessible(true);
|
Felix_BundleImpl_m_modules_field.setAccessible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Figure out which version of the modules is exported
|
||||||
|
Object currentModuleImpl;
|
||||||
|
try
|
||||||
|
{
|
||||||
Object[] moduleArray = (Object[])Felix_BundleImpl_m_modules_field.get(bundle);
|
Object[] moduleArray = (Object[])Felix_BundleImpl_m_modules_field.get(bundle);
|
||||||
Object currentModuleImpl = moduleArray[moduleArray.length - 1];
|
currentModuleImpl = moduleArray[moduleArray.length - 1];
|
||||||
|
}
|
||||||
|
catch (Throwable t2)
|
||||||
|
{
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
List<Object> moduleArray = (List<Object>)Felix_BundleImpl_m_modules_field.get(bundle);
|
||||||
|
currentModuleImpl = moduleArray.get(moduleArray.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (Felix_ModuleImpl_m_classLoader_field == null && currentModuleImpl != null)
|
if (Felix_ModuleImpl_m_classLoader_field == null && currentModuleImpl != null)
|
||||||
{
|
{
|
||||||
Felix_ModuleImpl_m_classLoader_field = bundle.getClass().getClassLoader().loadClass("org.apache.felix.framework.ModuleImpl").getDeclaredField(
|
Felix_ModuleImpl_m_classLoader_field = bundle.getClass().getClassLoader().loadClass("org.apache.felix.framework.ModuleImpl").getDeclaredField(
|
||||||
|
|
Loading…
Reference in New Issue