Package org.apache.sling.feature.extension.apiregions.launcher

# Class RegionLauncherExtension

java.lang.Object
org.apache.sling.feature.extension.apiregions.launcher.RegionLauncherExtension

All Implemented Interfaces:
  `org.apache.sling.feature.launcher.spi.extensions.ExtensionHandler`

public class RegionLauncherExtension extends Object implements org.apache.sling.feature.launcher.spi.extensions.ExtensionHandler
The `RegionLauncherExtension` class implements the `ExtensionHandler` interface to handle the API regions extension in the Sling feature model.

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.

It defines two constants for the filenames of the generated properties files:

- `FEATURE_REGION_FILENAME` - The filename for the feature regions properties file.
- `REGION_PACKAGE_FILENAME` - The filename for the region packages properties file.

The `handle` method performs the following steps:

1. Checks if the extension name matches the expected API regions extension name.
2. Creates a temporary directory for storing the generated properties files.
3. Parses the API regions from the extension's JSON structure.
4. Saves the feature regions and region packages mappings to the respective properties files.
5. Adds the generated properties files as framework properties to the extension context.

See Also:
  - `ExtensionHandler`
  - `ExtensionContext`
  - `Extension`
  - `ApiRegions`
  - `LauncherProperties`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`FEATURE_REGION_FILENAME`
`static final String`
`REGION_PACKAGE_FILENAME`

## Constructor Summary

Constructors
Constructor
Description
`RegionLauncherExtension()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`handle(org.apache.sling.feature.launcher.spi.extensions.ExtensionContext extensionContext, org.apache.sling.feature.Extension extension)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### FEATURE_REGION_FILENAME

public static final String FEATURE_REGION_FILENAME

See Also:
  - Constant Field Values

### REGION_PACKAGE_FILENAME

public static final String REGION_PACKAGE_FILENAME

See Also:
  - Constant Field Values

## Constructor Details

### RegionLauncherExtension

public RegionLauncherExtension()

## Method Details

### handle

public boolean handle(org.apache.sling.feature.launcher.spi.extensions.ExtensionContext extensionContext, org.apache.sling.feature.Extension extension) throws Exception

Specified by:
  `handle` in interface `org.apache.sling.feature.launcher.spi.extensions.ExtensionHandler`
Throws:
  `Exception`