Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBJ Hargrave2011-09-17 02:06:49 +0000
committerThomas Watson2011-09-26 13:59:55 +0000
commite13b75c05c99bc4cb16694e449bde94aaefbe57f (patch)
tree6a83e5118c6ce55cd6d6b8dbaad540340c37b671
parent95830aefcf72ab237738d916e8298e034f344c91 (diff)
downloadrt.equinox.framework-e13b75c05c99bc4cb16694e449bde94aaefbe57f.tar.gz
rt.equinox.framework-e13b75c05c99bc4cb16694e449bde94aaefbe57f.tar.xz
rt.equinox.framework-e13b75c05c99bc4cb16694e449bde94aaefbe57f.zip
Bug 358894 - [R4.4] Allow Bundle to be adapted to an AccessControlContext.
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
index 8acd9a9a2..e526bcb26 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java
@@ -1042,7 +1042,7 @@ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, Keye
* We can exploit our knowledge that the security context of FrameworkSecurityManager
* is an AccessControlContext to invoke it properly with the ProtectionDomain.
*/
- AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] {domain});
+ AccessControlContext acc = getAccessControlContext();
try {
sm.checkPermission((Permission) permission, acc);
return true;
@@ -1185,6 +1185,10 @@ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, Keye
return domain;
}
+ private AccessControlContext getAccessControlContext() {
+ return new AccessControlContext(new ProtectionDomain[] {domain});
+ }
+
protected BundleFragment[] getFragments() {
checkValid();
return null;
@@ -1483,6 +1487,11 @@ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, Keye
return null;
}
}
+
+ if (AccessControlContext.class.equals(adapterType)) {
+ return (A) getAccessControlContext();
+ }
+
if (BundleWiring.class.equals(adapterType)) {
if (state == UNINSTALLED)
return null;

Back to the top