summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-03-11 11:25:27 (EST)
committer Glyn Normington2011-03-11 11:25:27 (EST)
commitffc74a06b046ea080223f88b502b887f9581afc6 (patch)
treea8465d6135111574726685518dea4454d09152b5
parentf40763f49ddf7b5eb73e6b70063b76b5fea9828f (diff)
downloadorg.eclipse.virgo.kernel-ffc74a06b046ea080223f88b502b887f9581afc6.zip
org.eclipse.virgo.kernel-ffc74a06b046ea080223f88b502b887f9581afc6.tar.gz
org.eclipse.virgo.kernel-ffc74a06b046ea080223f88b502b887f9581afc6.tar.bz2
javadoc about immutable RegionFilter and getSharingPolicy
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/RegionFilter.java11
-rw-r--r--org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraph.java15
2 files changed, 25 insertions, 1 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 5fa872c..e0a8d67 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
@@ -24,7 +24,9 @@ import org.osgi.framework.wiring.BundleRevision;
/**
* A {@link RegionFilter} is associated with a connection from one region to another and determines the bundles,
- * packages, and services which are visible across the connection.
+ * packages, services and other capabilities which are visible across the connection. A region filter is constant; its
+ * sharing policy cannot be changed after construction. Instances of region filters can be created with a
+ * {@link RegionFilterBuilder}.
* <p />
*
* <strong>Concurrent Semantics</strong><br />
@@ -107,5 +109,12 @@ public interface RegionFilter {
*/
public boolean isCapabilityAllowed(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
+ * the value is a collection of filters for the name space. The returned map is a snapshot of the sharing policy.
+ * Changes made to the returned map have no affect on this region filter.
+ *
+ * @return a map containing the sharing policy used by this region filter
+ */
public Map<String, Collection<String>> getSharingPolicy();
}
diff --git a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraph.java b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraph.java
index a2612d4..4891848 100644
--- a/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraph.java
+++ b/org.eclipse.virgo.kernel.osgi/src/main/java/org/eclipse/virgo/kernel/osgi/region/internal/StandardRegionDigraph.java
@@ -299,4 +299,19 @@ public final class StandardRegionDigraph implements RegionDigraph {
}
return listeners;
}
+
+ /**
+ * Returns a snapshot of filtered regions
+ *
+ * @return a snapshot of filtered regions
+ */
+ Map<Region, Set<FilteredRegion>> getFilteredRegions() {
+ Map<Region, Set<FilteredRegion>> result = new HashMap<Region, Set<FilteredRegion>>();
+ synchronized (this.monitor) {
+ for (Region region : regions) {
+ result.put(region, getEdges(region));
+ }
+ }
+ return result;
+ }
}