This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-extension-apiregions.git
The following commit(s) were added to refs/heads/master by this push:
new a1d2c6d Add class file javadoc
a1d2c6d is described below
commit a1d2c6d58e1539c3a911c23d67efbb0e5154056b
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Fri Nov 15 10:51:25 2024 +0100
Add class file javadoc
---
.../apiregions/launcher/RegionLauncher.java | 31 ++++++++++++++++++++++
.../launcher/RegionLauncherExtension.java | 28 +++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git
a/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncher.java
b/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncher.java
index 01acd19..e79204e 100644
---
a/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncher.java
+++
b/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncher.java
@@ -29,6 +29,37 @@ import
org.apache.sling.feature.launcher.impl.launchers.FrameworkLauncher;
import org.apache.sling.feature.launcher.spi.LauncherPrepareContext;
import org.apache.sling.feature.launcher.spi.LauncherRunContext;
+/**
+ * The {@code RegionLauncher} class extends {@link FrameworkLauncher} and is
responsible for preparing
+ * and running the framework with specific configurations related to API
regions.
+ *
+ * <p>This class handles the creation and management of properties files that
map bundle IDs to their
+ * symbolic names and versions, as well as bundle IDs to features. These
properties files are used
+ * during the framework launch process.</p>
+ *
+ * <p>It overrides the {@code prepare} and {@code run} methods from {@link
FrameworkLauncher} to
+ * include additional setup steps specific to API regions.</p>
+ *
+ * <p>Constants:</p>
+ * <ul>
+ * <li>{@code IDBSNVER_FILENAME} - The filename for the properties file that
maps bundle IDs to their symbolic names and versions.</li>
+ * <li>{@code BUNDLE_FEATURE_FILENAME} - The filename for the properties
file that maps bundle IDs to features.</li>
+ * </ul>
+ *
+ * <p>Methods:</p>
+ * <ul>
+ * <li>{@code prepare(LauncherPrepareContext context, ArtifactId
frameworkId, Feature app)} - Prepares the framework by creating necessary
properties files and updating framework properties.</li>
+ * <li>{@code run(LauncherRunContext context, ClassLoader cl)} - Runs the
framework with the given context and class loader.</li>
+ * </ul>
+ *
+ * @see FrameworkLauncher
+ * @see LauncherPrepareContext
+ * @see LauncherRunContext
+ * @see ArtifactId
+ * @see Feature
+ * @see LauncherProperties
+ * @see RegionLauncherExtension
+ */
public class RegionLauncher extends FrameworkLauncher {
public static final String IDBSNVER_FILENAME = "idbsnver.properties";
diff --git
a/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncherExtension.java
b/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncherExtension.java
index 9f9dac3..2eb67d6 100644
---
a/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncherExtension.java
+++
b/src/main/java/org/apache/sling/feature/extension/apiregions/launcher/RegionLauncherExtension.java
@@ -26,6 +26,34 @@ import
org.apache.sling.feature.extension.apiregions.api.ApiRegions;
import org.apache.sling.feature.launcher.spi.extensions.ExtensionContext;
import org.apache.sling.feature.launcher.spi.extensions.ExtensionHandler;
+/**
+ * The {@code RegionLauncherExtension} class implements the {@code
ExtensionHandler} interface
+ * to handle the API regions extension in the Sling feature model.
+ *
+ * <p>This class processes the API regions extension, generates temporary
files for feature
+ * regions and region packages, and adds the corresponding framework
properties to the extension context.</p>
+ *
+ * <p>It defines two constants for the filenames of the generated properties
files:</p>
+ * <ul>
+ * <li>{@link #FEATURE_REGION_FILENAME} - The filename for the feature
regions properties file.</li>
+ * <li>{@link #REGION_PACKAGE_FILENAME} - The filename for the region
packages properties file.</li>
+ * </ul>
+ *
+ * <p>The {@code handle} method performs the following steps:</p>
+ * <ol>
+ * <li>Checks if the extension name matches the expected API regions
extension name.</li>
+ * <li>Creates a temporary directory for storing the generated properties
files.</li>
+ * <li>Parses the API regions from the extension's JSON structure.</li>
+ * <li>Saves the feature regions and region packages mappings to the
respective properties files.</li>
+ * <li>Adds the generated properties files as framework properties to the
extension context.</li>
+ * </ol>
+ *
+ * @see ExtensionHandler
+ * @see ExtensionContext
+ * @see Extension
+ * @see ApiRegions
+ * @see LauncherProperties
+ */
public class RegionLauncherExtension implements ExtensionHandler {
public static final String FEATURE_REGION_FILENAME = "features.properties";