diff options
author | BJ Hargrave | 2011-09-17 02:06:49 +0000 |
---|---|---|
committer | Thomas Watson | 2011-09-26 13:59:55 +0000 |
commit | e13b75c05c99bc4cb16694e449bde94aaefbe57f (patch) | |
tree | 6a83e5118c6ce55cd6d6b8dbaad540340c37b671 | |
parent | 95830aefcf72ab237738d916e8298e034f344c91 (diff) | |
download | rt.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.java | 11 |
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; |