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-launcher.git
The following commit(s) were added to refs/heads/master by this push:
new dcb7e13 SLING-10005 : Document the ExtensionHandler interface
dcb7e13 is described below
commit dcb7e1332e6229167135a2cf0f8df50a99406da0
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Wed Dec 16 15:15:16 2020 +0100
SLING-10005 : Document the ExtensionHandler interface
---
.../launcher/spi/extensions/ExtensionHandler.java | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git
a/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionHandler.java
b/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionHandler.java
index acb8347..976b065 100644
---
a/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionHandler.java
+++
b/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionHandler.java
@@ -18,7 +18,25 @@ package org.apache.sling.feature.launcher.spi.extensions;
import org.apache.sling.feature.Extension;
-public interface ExtensionHandler
-{
+/**
+ * A extension handler can be used to add additional functionality to the
launcher
+ * based on extension in the feature model. For example, the Apache Sling
specific
+ * extension for repoinit is unknown to the launcher. An extension handler can
be
+ * used to handle that extension and provide the information to the runtime.
+ * Before launching, the extension handlers are called until a handler returns
{@code true}
+ * for an extension. Therefore only one handler can be invoked for a given
extension.
+ * An extension handler is needed for every required extension in the feature
model.
+ */
+public interface ExtensionHandler {
+
+ /**
+ * Try to handle the extension. As soon as a handler returns {@code true},
+ * no other handler is invoked for this extension.
+ *
+ * @param context Context for the handler
+ * @param extension The feature model extension
+ * @return {@code true} if the handler handled the extension.
+ * @throws Exception If an error occurs during processing of the extension.
+ */
public boolean handle(ExtensionContext context, Extension extension)
throws Exception;
}