Improve A2 provisioning framework.
[lgpl/argeo-commons.git] / org.argeo.osgi.boot / src / org / argeo / osgi / boot / a2 / A2Contribution.java
index 9e6ca3084b7b75751f1501999dc8d008c160708e..e81ecadc8b9d661b5606a0195dd71f2b07c6ecfa 100644 (file)
@@ -4,20 +4,30 @@ import java.util.Collections;
 import java.util.Map;
 import java.util.TreeMap;
 
-class A2Contribution implements Comparable<A2Contribution> {
+/**
+ * A category grouping a set of {@link A2Component}, typically based on the
+ * provider of these components. This is the equivalent of Maven's group Id.
+ */
+public class A2Contribution implements Comparable<A2Contribution> {
        final static String BOOT = "boot";
        final static String RUNTIME = "runtime";
+       final static String CLASSPATH = "classpath";
 
        private final ProvisioningSource source;
        private final String id;
 
        final Map<String, A2Component> components = Collections.synchronizedSortedMap(new TreeMap<>());
 
+       /**
+        * The contribution must be added to the source. Rather use
+        * {@link AbstractProvisioningSource#getOrAddContribution(String)} than this
+        * contructor directly.
+        */
        public A2Contribution(ProvisioningSource context, String id) {
                this.source = context;
                this.id = id;
-               if (context != null)
-                       context.contributions.put(id, this);
+//             if (context != null)
+//                     context.contributions.put(id, this);
        }
 
        A2Component getOrAddComponent(String componentId) {