Added support for FrameworkUtil.getBundle(). (FELIX-1289)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@790160 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java b/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
index 115335b..802f7f5 100644
--- a/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
@@ -28,8 +28,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLStreamHandler;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
import java.security.SecureClassLoader;
import java.util.ArrayList;
@@ -54,6 +52,7 @@
import org.apache.felix.framework.util.manifestparser.Requirement;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleReference;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.Version;
@@ -1556,7 +1555,7 @@
m_dexFileClassLoadClass = dexFileClassLoadClass;
}
- public class ModuleClassLoader extends SecureClassLoader
+ public class ModuleClassLoader extends SecureClassLoader implements BundleReference
{
private final Map m_jarContentToDexFile;
@@ -1573,7 +1572,12 @@
}
}
- public IModule getModule()
+ public Bundle getBundle()
+ {
+ return ModuleImpl.this.getBundle();
+ }
+
+ IModule getModule()
{
return ModuleImpl.this;
}