aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-03-11 12:28:49 (EST)
committerGlyn Normington2011-03-11 12:28:49 (EST)
commit438a11cff913708ca5cff24f8c43638fdd761702 (patch)
tree87e0ba8d55ca5f6e03fb502eb81e9df65a60b2ff
parent23ec496d7526a62bdade2b21a6b75aae67ee2c24 (diff)
downloadorg.eclipse.virgo.kernel-438a11cff913708ca5cff24f8c43638fdd761702.zip
org.eclipse.virgo.kernel-438a11cff913708ca5cff24f8c43638fdd761702.tar.gz
org.eclipse.virgo.kernel-438a11cff913708ca5cff24f8c43638fdd761702.tar.bz2
Change all RegionFilter.is*Allowed(...) methods to RegionFilter.isAllowed(...)
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/RegionFilter.java8
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionBundleFindHook.java2
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionResolverHook.java2
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionServiceFindHook.java2
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilter.java8
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/test/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilterTests.java14
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java2
7 files changed, 19 insertions, 19 deletions
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/RegionFilter.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/RegionFilter.java
index e0a8d67..95d80bd 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/RegionFilter.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/RegionFilter.java
@@ -83,7 +83,7 @@ public interface RegionFilter {
* @param bundle the bundle
* @return <code>true</code> if the bundle is allowed and <code>false</code>otherwise
*/
- public boolean isBundleAllowed(Bundle bundle);
+ public boolean isAllowed(Bundle bundle);
/**
* Determines whether this filter allows the given bundle
@@ -91,7 +91,7 @@ public interface RegionFilter {
* @param bundle the bundle revision
* @return <code>true</code> if the bundle is allowed and <code>false</code>otherwise
*/
- public boolean isBundleAllowed(BundleRevision bundle);
+ public boolean isAllowed(BundleRevision bundle);
/**
* Determines whether this filter allows the given service reference.
@@ -99,7 +99,7 @@ public interface RegionFilter {
* @param service the service reference of the service
* @return <code>true</code> if the service is allowed and <code>false</code>otherwise
*/
- public boolean isServiceAllowed(ServiceReference<?> service);
+ public boolean isAllowed(ServiceReference<?> service);
/**
* Determines whether this filter allows the given capability.
@@ -107,7 +107,7 @@ public interface RegionFilter {
* @param capability the bundle capability
* @return <code>true</code> if the capability is allowed and <code>false</code>otherwise
*/
- public boolean isCapabilityAllowed(BundleCapability capability);
+ public boolean isAllowed(BundleCapability capability);
/**
* Returns a map of the filters used by each name space for this region filter. The may key is the name space and
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionBundleFindHook.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionBundleFindHook.java
index 4f3aee4..016de4b 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionBundleFindHook.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionBundleFindHook.java
@@ -77,7 +77,7 @@ public final class RegionBundleFindHook implements FindHook {
*/
@Override
protected boolean isAllowed(Bundle candidate, RegionFilter filter) {
- return filter.isBundleAllowed(candidate);
+ return filter.isAllowed(candidate);
}
}
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionResolverHook.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionResolverHook.java
index d868f68..8adedb5 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionResolverHook.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionResolverHook.java
@@ -88,7 +88,7 @@ final class RegionResolverHook implements ResolverHook {
@Override
protected boolean isAllowed(BundleCapability candidate, RegionFilter filter) {
- return filter.isCapabilityAllowed(candidate) || filter.isBundleAllowed(candidate.getRevision());
+ return filter.isAllowed(candidate) || filter.isAllowed(candidate.getRevision());
}
}
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionServiceFindHook.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionServiceFindHook.java
index fd561c4..a027c33 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionServiceFindHook.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/hook/RegionServiceFindHook.java
@@ -78,7 +78,7 @@ public final class RegionServiceFindHook implements FindHook {
*/
@Override
protected boolean isAllowed(ServiceReference<?> candidate, RegionFilter filter) {
- return filter.isServiceAllowed(candidate) || filter.isBundleAllowed(candidate.getBundle());
+ return filter.isAllowed(candidate) || filter.isAllowed(candidate.getBundle());
}
}
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilter.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilter.java
index b6c579d..f81b2ff 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilter.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilter.java
@@ -45,7 +45,7 @@ final class StandardRegionFilter implements RegionFilter {
* @param bundle the bundle
* @return <code>true</code> if the bundle is allowed and <code>false</code>otherwise
*/
- public boolean isBundleAllowed(Bundle bundle) {
+ public boolean isAllowed(Bundle bundle) {
HashMap<String, Object> attrs = new HashMap<String, Object>(3);
String bsn = bundle.getSymbolicName();
if (bsn != null)
@@ -60,7 +60,7 @@ final class StandardRegionFilter implements RegionFilter {
* @param bundle the bundle revision
* @return <code>true</code> if the bundle is allowed and <code>false</code>otherwise
*/
- public boolean isBundleAllowed(BundleRevision bundle) {
+ public boolean isAllowed(BundleRevision bundle) {
HashMap<String, Object> attrs = new HashMap<String, Object>(3);
String bsn = bundle.getSymbolicName();
if (bsn != null)
@@ -107,7 +107,7 @@ final class StandardRegionFilter implements RegionFilter {
* @param service the service reference of the service
* @return <code>true</code> if the service is allowed and <code>false</code>otherwise
*/
- public boolean isServiceAllowed(ServiceReference<?> service) {
+ public boolean isAllowed(ServiceReference<?> service) {
if (match(filters.get(VISIBLE_SERVICE_NAMESPACE), service))
return true;
return match(filters.get(VISIBLE_ALL_NAMESPACE), service);
@@ -119,7 +119,7 @@ final class StandardRegionFilter implements RegionFilter {
* @param capability the bundle capability
* @return <code>true</code> if the capability is allowed and <code>false</code>otherwise
*/
- public boolean isCapabilityAllowed(BundleCapability capability) {
+ public boolean isAllowed(BundleCapability capability) {
String namespace = capability.getNamespace();
Map<String, ?> attrs = capability.getAttributes();
if (match(filters.get(namespace), attrs))
diff --git a/org.eclipse.virgo.kernel.osgi/src/test/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilterTests.java b/org.eclipse.virgo.kernel.osgi/src/test/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilterTests.java
index 97858ef..fb52b0e 100644
--- a/org.eclipse.virgo.kernel.osgi/src/test/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilterTests.java
+++ b/org.eclipse.virgo.kernel.osgi/src/test/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionFilterTests.java
@@ -76,19 +76,19 @@ public class StandardRegionFilterTests {
@Test
public void testAllowBundle() throws InvalidSyntaxException {
RegionFilter regionFilter = createBundleFilter(BUNDLE_SYMBOLIC_NAME, BUNDLE_VERSION);
- assertTrue(regionFilter.isBundleAllowed(stubBundle));
+ assertTrue(regionFilter.isAllowed(stubBundle));
}
@Test
public void testBundleNotAllowed() throws InvalidSyntaxException {
RegionFilter regionFilter = new StandardRegionFilter(Collections.EMPTY_MAP);
- assertFalse(regionFilter.isBundleAllowed(stubBundle));
+ assertFalse(regionFilter.isAllowed(stubBundle));
}
@Test
public void testBundleNotAllowedInRange() throws InvalidSyntaxException {
RegionFilter regionFilter = createBundleFilter(BUNDLE_SYMBOLIC_NAME, new Version(1, 0, 0));
- assertFalse(regionFilter.isBundleAllowed(stubBundle));
+ assertFalse(regionFilter.isAllowed(stubBundle));
}
@Test
@@ -100,7 +100,7 @@ public class StandardRegionFilterTests {
EasyMock.expect(packageCapability.getNamespace()).andReturn(BundleRevision.PACKAGE_NAMESPACE).anyTimes();
EasyMock.expect(packageCapability.getAttributes()).andReturn(attrs).anyTimes();
EasyMock.replay(packageCapability);
- assertTrue(regionFilter.isCapabilityAllowed(packageCapability));
+ assertTrue(regionFilter.isAllowed(packageCapability));
assertEquals(Arrays.asList(this.packageImportPolicy), regionFilter.getSharingPolicy().get(RegionFilter.VISIBLE_PACKAGE_NAMESPACE));
}
@@ -113,7 +113,7 @@ public class StandardRegionFilterTests {
EasyMock.expect(packageCapability.getNamespace()).andReturn(BundleRevision.PACKAGE_NAMESPACE).anyTimes();
EasyMock.expect(packageCapability.getAttributes()).andReturn(attrs).anyTimes();
EasyMock.replay(packageCapability);
- assertFalse(regionFilter.isCapabilityAllowed(packageCapability));
+ assertFalse(regionFilter.isAllowed(packageCapability));
assertEquals(Arrays.asList(this.packageImportPolicy), regionFilter.getSharingPolicy().get(RegionFilter.VISIBLE_PACKAGE_NAMESPACE));
}
@@ -121,7 +121,7 @@ public class StandardRegionFilterTests {
public void testServiceImportAllowed() throws InvalidSyntaxException {
RegionFilter regionFilter = createRegionFilter(RegionFilter.VISIBLE_SERVICE_NAMESPACE, Arrays.asList(serviceImportPolicy));
ServiceRegistration<?> reg = new StubServiceRegistration<Object>(new StubBundleContext(), "foo.Service");
- assertTrue(regionFilter.isServiceAllowed(reg.getReference()));
+ assertTrue(regionFilter.isAllowed(reg.getReference()));
assertEquals(Arrays.asList(serviceImportPolicy), regionFilter.getSharingPolicy().get(RegionFilter.VISIBLE_SERVICE_NAMESPACE));
}
@@ -129,7 +129,7 @@ public class StandardRegionFilterTests {
public void testServiceImportNotAllowed() throws InvalidSyntaxException {
RegionFilter regionFilter = createRegionFilter(RegionFilter.VISIBLE_SERVICE_NAMESPACE, Arrays.asList(serviceImportPolicy));
ServiceRegistration<?> reg = new StubServiceRegistration<Object>(new StubBundleContext(), "bar.Service");
- assertFalse(regionFilter.isServiceAllowed(reg.getReference()));
+ assertFalse(regionFilter.isAllowed(reg.getReference()));
assertEquals(Arrays.asList(serviceImportPolicy), regionFilter.getSharingPolicy().get(RegionFilter.VISIBLE_SERVICE_NAMESPACE));
}
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java
index 7200d86..7c747bc 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java
@@ -361,7 +361,7 @@ public final class DependencyCalculator {
Region userRegion = edge.getRegion();
RegionFilter filter = edge.getFilter();
long bundleId = bundleDescription.getBundleId();
- if ((bundleId == 0L || this.coregion.contains(bundleId) || (filter.isBundleAllowed(bundleDescription) && userRegion.contains(bundleId)))) {
+ if ((bundleId == 0L || this.coregion.contains(bundleId) || (filter.isAllowed(bundleDescription) && userRegion.contains(bundleId)))) {
return true;
}
}