Introduce runtime manager
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / a2 / A2Component.java
index 2b6814f6b839bb9dab2c0421069f0e98fe4bd9e0..8942706300ee74b423c6e5cec959e68e600b9faa 100644 (file)
@@ -23,11 +23,16 @@ public class A2Component implements Comparable<A2Component> {
                contribution.components.put(id, this);
        }
 
+       public Iterable<A2Branch> listBranches(Object filter) {
+               return branches.values();
+       }
+
        A2Branch getOrAddBranch(String branchId) {
-               if (branches.containsKey(branchId))
-                       return branches.get(branchId);
-               else
-                       return new A2Branch(this, branchId);
+               if (!branches.containsKey(branchId)) {
+                       A2Branch a2Branch = new A2Branch(this, branchId);
+                       branches.put(branchId, a2Branch);
+               }
+               return branches.get(branchId);
        }
 
        A2Module getOrAddModule(Version version, Object locator) {
@@ -36,15 +41,15 @@ public class A2Component implements Comparable<A2Component> {
                return module;
        }
 
-       A2Branch last() {
+       public A2Branch last() {
                return branches.get(branches.lastKey());
        }
 
-       A2Contribution getContribution() {
+       public A2Contribution getContribution() {
                return contribution;
        }
 
-       String getId() {
+       public String getId() {
                return id;
        }