You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2019/12/19 15:22:55 UTC
[sling-whiteboard] branch master updated: Additional Javadoc
This is an automated email from the ASF dual-hosted git repository.
davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 582619d Additional Javadoc
582619d is described below
commit 582619d570920ca8666c52a37fa0038ab16bcff9
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Thu Dec 19 15:22:36 2019 +0000
Additional Javadoc
---
.../src/main/java/org/osgi/feature/ConflictResolver.java | 6 ++++++
.../src/main/java/org/osgi/feature/FeatureService.java | 9 ++++++++-
.../src/main/java/org/osgi/feature/MergeContext.java | 16 ++++++++++++++--
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/ConflictResolver.java b/osgi-featuremodel/src/main/java/org/osgi/feature/ConflictResolver.java
index 2cedced..da7e5a3 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/ConflictResolver.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/ConflictResolver.java
@@ -16,6 +16,12 @@
*/
package org.osgi.feature;
+/**
+ * Interface implemented by a callback that can resolve merge conflicts.
+ * @param <T> The type of entity this conflict resolver is used for.
+ * @param <R> The type of the result of the resoluton.
+ * @ConsumerType
+ */
public interface ConflictResolver<T, R> {
R resolve(Feature f1, T o1, Feature f2, T o2);
}
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/FeatureService.java b/osgi-featuremodel/src/main/java/org/osgi/feature/FeatureService.java
index 01e9862..3051e3c 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/FeatureService.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/FeatureService.java
@@ -37,6 +37,13 @@ public interface FeatureService {
*/
void writeFeature(Feature feature, Writer jsonWriter) throws IOException;
-
+ /**
+ * Merge two features into a new feature.
+ * @param targetID The ID of the new feature.
+ * @param f1 The first feature
+ * @param f2 The second feature
+ * @param ctx The merge context to use for the merge operation.
+ * @return The merged feature.
+ */
Feature mergeFeatures(ArtifactID targetID, Feature f1, Feature f2, MergeContext ctx);
}
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/MergeContext.java b/osgi-featuremodel/src/main/java/org/osgi/feature/MergeContext.java
index 761daa1..274f431 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/MergeContext.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/MergeContext.java
@@ -20,14 +20,15 @@ import java.util.List;
/**
* Context provided by the caller for the merge operation.
- * @ConsumerType
*/
public interface MergeContext {
/**
* If two merged features both contain the same bundle, same group ID and
* artifact ID but different version, this method is called to resolve what to
* do.
+ * @param f1 The first feature.
* @param b1 The first bundle.
+ * @param f2 The second feature.
* @param b2 The second bundle.
* @return Return a list of bundles that should be used in this case. This could
* be one or both of the provided bundles, or a different bundle altogether.
@@ -37,11 +38,22 @@ public interface MergeContext {
/**
* If two merged features both contain the same configuration PID, this method
* is called to perform the merge operation.
+ * @param f1 The first feature.
* @param c1 The first configuration.
+ * @param f2 The second feature.
* @param c2 The second configuration.
- * @return The configuration to use.
+ * @return The merged configuration to use.
*/
Configuration handleConfigurationConflict(Feature f1, Configuration c1, Feature f2, Configuration c2);
+ /**
+ * If two merged features both contain an extension with the same IF, this method
+ * is called to perform the merge operation.
+ * @param f1 The first feature.
+ * @param e1 The first extension.
+ * @param f2 The second feature.
+ * @param e2 The second extension.
+ * @return The merged extension.
+ */
Extension handleExtensionConflict(Feature f1, Extension e1, Feature f2, Extension e2);
}