Author: pauls
Date: Wed Mar 5 04:45:26 2008
New Revision: 633835
URL: http://svn.apache.org/viewvc?rev=633835&view=rev
Log:
Add a method to the external interface and fix hashcode, equals, and hashcode.
Modified:
felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
felix/trunk/framework/src/main/java/org/apache/felix/framework/ext/SecurityProvider.java
Modified:
felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
URL:
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java?rev=633835&r1=633834&r2=633835&view=diff
==============================================================================
---
felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
(original)
+++
felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
Wed Mar 5 04:45:26 2008
@@ -21,7 +21,7 @@
import java.security.Permission;
import java.security.ProtectionDomain;
-class BundleProtectionDomain extends ProtectionDomain
+public class BundleProtectionDomain extends ProtectionDomain
{
private final Felix m_felix;
private final FelixBundle m_bundle;
@@ -38,6 +38,11 @@
return m_felix.impliesBundlePermission(this, permission, false);
}
+ public boolean impliesDirect(Permission permission)
+ {
+ return m_felix.impliesBundlePermission(this, permission, true);
+ }
+
FelixBundle getBundle()
{
return m_bundle;
@@ -50,6 +55,15 @@
public boolean equals(Object other)
{
- return m_bundle.equals(other);
+ if ((other == null) || other.getClass() !=
BundleProtectionDomain.class)
+ {
+ return false;
+ }
+ return m_bundle == ((BundleProtectionDomain) other).m_bundle;
+ }
+
+ public String toString()
+ {
+ return "[" + m_bundle + "]";
}
}
Modified:
felix/trunk/framework/src/main/java/org/apache/felix/framework/ext/SecurityProvider.java
URL:
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ext/SecurityProvider.java?rev=633835&r1=633834&r2=633835&view=diff
==============================================================================
---
felix/trunk/framework/src/main/java/org/apache/felix/framework/ext/SecurityProvider.java
(original)
+++
felix/trunk/framework/src/main/java/org/apache/felix/framework/ext/SecurityProvider.java
Wed Mar 5 04:45:26 2008
@@ -28,4 +28,6 @@
boolean hasBundlePermission(ProtectionDomain pd, Permission p, boolean
direct);
Object getSignerMatcher(Bundle bundle);
+
+ void checkBundle(Bundle bundle) throws Exception;
}