Applied feedbacks that Jan Willem sent to me about the new dm-lambda library:
- renamed the DependencyManagerActivator.activate() method to init(BundleContext ctx, DependencyManager dm)
- Removed abbreviated names like "cb()" or "cbi" methods, and replaced them with niced method names like "add()/changed()/removed()" ...
- Added a system property "org.apache.felix.dependencymanager.lambda.dependencymode" that allows to control the default
mode of dependency (still to be discussed).
- added full support or new configuration types.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1731147 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/InstanceCbConfiguration.java b/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/InstanceCbConfiguration.java
new file mode 100644
index 0000000..6f60523
--- /dev/null
+++ b/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/callbacks/InstanceCbConfiguration.java
@@ -0,0 +1,28 @@
+package org.apache.felix.dm.lambda.callbacks;
+
+import java.util.Objects;
+
+/**
+ * Represents a reference to a callback on an Object instance that takes Configuration type as argument.
+ * For more informations about configuration type, please refer to {@link CbConfiguration}.
+ *
+ * <p> The T generic parameter represents the type of the configuration class passed to the callback argument.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@FunctionalInterface
+public interface InstanceCbConfiguration<T> extends SerializableLambda {
+ /**
+ * Handles the given argument.
+ * @param configType the configuration type
+ */
+ void accept(T configType);
+
+ default InstanceCbConfiguration<T> andThen(InstanceCbConfiguration<T> after) {
+ Objects.requireNonNull(after);
+ return (T configProxy) -> {
+ accept(configProxy);
+ after.accept(configProxy);
+ };
+ }
+}