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 2020/01/06 16:15:41 UTC
[sling-whiteboard] branch master updated: More 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 69eec2b More Javadoc
69eec2b is described below
commit 69eec2b106e0b4fdd207a0898f4fc757b2ee0ddd
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Mon Jan 6 16:15:22 2020 +0000
More Javadoc
---
.../main/java/org/osgi/feature/Configuration.java | 16 ++++++++
.../java/org/osgi/feature/ConflictResolver.java | 11 ++++-
.../src/main/java/org/osgi/feature/Extension.java | 37 +++++++++++++++++
.../src/main/java/org/osgi/feature/Feature.java | 48 ++++++++++++++++++++++
.../main/java/org/osgi/feature/FeatureService.java | 8 +++-
5 files changed, 117 insertions(+), 3 deletions(-)
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Configuration.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Configuration.java
index 4bd7782..4890b91 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Configuration.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Configuration.java
@@ -18,10 +18,26 @@ package org.osgi.feature;
import java.util.Map;
+/**
+ * Represents an OSGi Configuration in the Feature Model.
+ * @ThreadSafe
+ */
public interface Configuration {
+ /**
+ * Get the PID from the configuration.
+ * @return The PID.
+ */
String getPid();
+ /**
+ * Get the Factory PID from the configuration, if any.
+ * @return The Factory PID, or {@code null} if there is none.
+ */
String getFactoryPid();
+ /**
+ * Get the configuration key-value map.
+ * @return The key-value map.
+ */
Map<String, Object> getValues();
}
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 da7e5a3..9d20fae 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/ConflictResolver.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/ConflictResolver.java
@@ -19,9 +19,18 @@ 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.
+ * @param <R> The type of the result of the resolution.
* @ConsumerType
+ * @ThreadSafe
*/
public interface ConflictResolver<T, R> {
+ /**
+ * Resolve this conflict between o1 and o2.
+ * @param f1 The first feature model.
+ * @param o1 The first conflicting object.
+ * @param f2 The second feature model
+ * @param o2 The second conflicting object.
+ * @return The resolution of the conflict.
+ */
R resolve(Feature f1, T o1, Feature f2, T o2);
}
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Extension.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Extension.java
index ab2ca1d..0f00deb 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Extension.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Extension.java
@@ -18,19 +18,56 @@ package org.osgi.feature;
import java.util.List;
+/**
+ * A Feature Model Extension. Extensions can contain either Text, JSON or
+ * a list of Artifacts. <p>
+ * Extensions are of one of the following kinds:
+ * <ul>
+ * <li> Mandatory: this extension must be processed by the runtime
+ * <li> Optional: this extension does not have to be processed by the runtime
+ * <li> Transient: this extension contains transient information such as caching
+ * data that is for optimization purposes. It may be changed or removed and is
+ * not part of the feature's identity.
+ * </ul>
+ * @ThreadSafe
+ */
public interface Extension {
enum Kind { MANDATORY, OPTIONAL, TRANSIENT };
enum Type { JSON, TEXT, ARTIFACTS };
+ /**
+ * Get the extension name.
+ * @return The name.
+ */
String getName();
+ /**
+ * Get the extension type.
+ * @return The type.
+ */
Type getType();
+ /**
+ * Get the extension kind.
+ * @return The kind.
+ */
Kind getKind();
+ /**
+ * Get the JSON from this extension.
+ * @return The JSON, or {@code null} if this is not a JSON extension.
+ */
String getJSON();
+ /**
+ * Get the Text from this extension.
+ * @return The Text, or {@code null} if this is not a Text extension.
+ */
String getText();
+ /**
+ * Get the Artifacts from this extension.
+ * @return The Artifacts, or {@code null} if this is not an Artifacts extension.
+ */
List<ArtifactID> getArtifacts();
}
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java
index 8c8a1ad..0828a52 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java
@@ -19,27 +19,75 @@ package org.osgi.feature;
import java.util.List;
import java.util.Map;
+/**
+ * The Feature Model Feature.
+ * @ThreadSafe
+ */
public interface Feature extends Artifact {
+ /**
+ * Get the title.
+ * @return The title.
+ */
String getTitle();
+ /**
+ * Get the description.
+ * @return The description.
+ */
String getDescription();
+ /**
+ * Get the vendor.
+ * @return The vendor.
+ */
String getVendor();
+ /**
+ * Get the license.
+ * @return The license.
+ */
String getLicense();
+ /**
+ * Get the location.
+ * @return The location.
+ */
String getLocation();
+ /**
+ * Get whether the feature is complete or not.
+ * @return Completeness value.
+ */
boolean isComplete();
+ /**
+ * Get whether the feature is final or not.
+ * @return Final value.
+ */
boolean isFinal();
+ /**
+ * Get the bundles.
+ * @return The bundles.
+ */
List<Bundle> getBundles();
+ /**
+ * Get the configurations.
+ * @return The configurations.
+ */
Map<String, Configuration> getConfigurations();
+ /**
+ * Get the extensions.
+ * @return The extensions.
+ */
Map<String, Extension> getExtensions();
+ /**
+ * Get the variables.
+ * @return The variables.
+ */
Map<String, String> getVariables();
// add prototype
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 16439bf..65442c8 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/FeatureService.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/FeatureService.java
@@ -20,10 +20,14 @@ import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
+/**
+ * The Feature Service is the primary entry point for interacting with the feature model.
+ * @ThreadSafe
+ */
public interface FeatureService {
/**
- *
- * @return
+ * Get a factory which can be used to build feature model entities.
+ * @return A builder factory.
*/
BuilderFactory getBuilderFactory();