felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1727440 - in /felix/sandbox/pderop/dependencymanager-lambda: org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/builder/lambda/itest/ org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ org.apache...
Date Thu, 28 Jan 2016 21:32:55 GMT
Author: pderop
Date: Thu Jan 28 21:32:55 2016
New Revision: 1727440

URL: http://svn.apache.org/viewvc?rev=1727440&view=rev
Log:
Added javadocs.
Fixed API for BundleDependencyBuilder and BundleAdapterBuilder interfaces.

Modified:
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/builder/lambda/itest/BundleAdapterTest.java
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyActivatorBase.java
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
    felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/BundleAdapterBuilderImpl.java

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/builder/lambda/itest/BundleAdapterTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/builder/lambda/itest/BundleAdapterTest.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/builder/lambda/itest/BundleAdapterTest.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda.itest/src/org/apache/felix/dm/builder/lambda/itest/BundleAdapterTest.java
Thu Jan 28 21:32:55 2016
@@ -66,7 +66,7 @@ public class BundleAdapterTest extends T
         
         Component adapter = bundleAdapter(m)
             .mask(Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE)
-            .cb(cbInstance, "add", "remove")
+            .cbi(cbInstance, "add", "remove")
             .impl(baWithCb)
             .provides(BundleAdapter.class.getName())
             .build();

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleAdapterBuilder.java
Thu Jan 28 21:32:55 2016
@@ -6,21 +6,35 @@ import org.apache.felix.dm.lambda.callba
 import org.apache.felix.dm.lambda.callbacks.CbTypeComponentBundle;
 
 /**
- * Defines the interface for a Dependency Manager Factory Configuration Adapter.
+ * Builder interface for a DM Bundle Adapter.
  * 
- * Example that defines a factory configuration adapter service for the "foo.bar" factory
pid.
+ * <p> Example that creates a MyBundleAdapter service for each started bundle (the
bundle is added by reflection on
+ * class field with a Bundle type):
  * 
- * <pre> {@code
+ * <blockquote><pre>
  * public class Activator extends DependencyActivatorBase {
  *     public void init() throws Exception { 
- *         factoryPidAdapter(comp -> comp
- *             .factoryPid("foo.bar").onUpdate(ServiceImpl::updated).propagate()
- *             .impl(DictionaryImpl.class)
- *             .withService(LogService.class, dep -> dep.required(false)));
+ *       bundleAdapter(adapt -> adapt
+ *           .impl(MyBundleAdapterImpl.class)
+ *           .provides(MyBundleAdapter.class)
+ *           .mask(Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE));
  *    }
- * }</pre>
+ * } </pre></blockquote>
+ * 
+ * Example that creates a MyBundleAdapter service for each started bundle (the bundle is
added using a method reference):
+ * 
+ * <blockquote><pre>
+ * public class Activator extends DependencyActivatorBase {
+ *     public void init() throws Exception { 
+ *       bundleAdapter(adapt -> adapt
+ *           .impl(MyBundleAdapterImpl.class)
+ *           .provides(MyBundleAdapter.class)
+ *           .mask(Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE)
+ *           .cb(MyBundleAdapterImpl::setBundle));
+ *    }
+ * } </pre></blockquote>
  *
- * TODO: javadoc
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface BundleAdapterBuilder extends ComponentBuilder<BundleAdapterBuilder>
{
     /**
@@ -35,7 +49,7 @@ public interface BundleAdapterBuilder ex
      * Sets the filter condition to depend on. Filters are matched against the full manifest
of a bundle.
      * 
      * @param filter the filter condition
-     * @return the bundle dependency builder
+     * @return this builder
      * @throws IllegalArgumentException if the filter is invalid
      */
     BundleAdapterBuilder filter(String filter);
@@ -45,7 +59,7 @@ public interface BundleAdapterBuilder ex
      * to the service properties of the component that has this dependency (if it registers
as a service).
      * 
      * @param propagate <code>true</code> to propagate the bundle manifest properties
-     * @return the bundle dependency builder
+     * @return this builder
      */
     BundleAdapterBuilder propagate(boolean propagate);
     
@@ -54,24 +68,151 @@ public interface BundleAdapterBuilder ex
      * to the service properties of the component that has this dependency (if it registers
as a service).
      * 
      * @param propagate <code>true</code> to propagate the bundle manifest properties
-     * @return the bundle dependency builder
+     * @return this builder
      */
     BundleAdapterBuilder propagate();
     
+    /**
+     * Sets some <code>callback</code> methods to invoke on the component instance(s).
When a bundle state matches the bundle 
+     * adapter filter, then the bundle is injected using the specified callback methods.
When you specify one callback, it stands for the "add" callback.
+     * When you specify two callbacks, the first one corresponds to the "add" callback, and
the second one to the "remove" callback. When you specify three
+     * callbacks, the first one stands for the "add" callback, the second one for the "change"
callback, and the third one for the "remove" callback.
+     * 
+     * @param callbacks a list of callbacks (1 param -> "add", 2 params -> "add"/remove",
3 params -> "add"/"change"/"remove" callbacks).
+     * @return this builder
+     */
     BundleAdapterBuilder cb(String ... callbacks);
-    BundleAdapterBuilder cb(Object callbackInstance, String ... callbacks);
+    
+    /**
+     * Sets some <code>callback instance</code> methods to invoke on a given
Object instance. When a bundle state matches the bundle 
+     * adapter filter, then the bundle is injected using the specified callback methods.
When you specify one callback, it stands for the "add" callback.
+     * When you specify two callbacks, the first one corresponds to the "add" callback, and
the second one to the "remove" callback. 
+     * When you specify three callbacks, the first one stands for the "add" callback, the
second one for the "change" callback, and the third one for 
+     * the "remove" callback.
+     * 
+     * @param callbackInstance the Object instance where the callbacks are invoked on
+     * @param callbacks a list of callbacks (1 param -> "add", 2 params -> "add"/remove",
3 params -> "add"/"change"/"remove" callbacks).
+     * @return this builder
+     */
+    BundleAdapterBuilder cbi(Object callbackInstance, String ... callbacks);
 
+    /**
+     * Sets a <code>callback</code> java8 method reference which is invoked when
a bundle is added.
+     * The method reference must point to a Component implementation class method, and take
as argument a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
     <T> BundleAdapterBuilder cb(CbTypeBundle<T> add);
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
     <T> BundleAdapterBuilder cb(CbTypeBundle<T> add, CbTypeBundle<T> remove);
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, changed or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
     <T> BundleAdapterBuilder cb(CbTypeBundle<T> add, CbTypeBundle<T> change,
CbTypeBundle<T> remove);
+    
+    /**
+     * Sets a <code>callback</code> java8 method reference which is invoked when
a bundle is added.
+     * The method reference must point to a Component implementation class method, and take
as argument a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
+    <T> BundleAdapterBuilder cb(CbTypeComponentBundle<T> add);    
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    <T> BundleAdapterBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
remove);   
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, changed or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    <T> BundleAdapterBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
change, CbTypeComponentBundle<T> remove);         
+
+    /**
+     * Sets a <code>callback instance</code> java8 method reference which is
invoked when a bundle is added. 
+     * The method reference must point to an Object instance method, and takes as argument
a Bundle parameter.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
     BundleAdapterBuilder cbi(CbBundle add);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added or removed. 
+     * The method references must point to an Object instance method, and take as argument
a Bundle parameter.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
     BundleAdapterBuilder cbi(CbBundle add, CbBundle remove);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added, changed or removed.
+     * The method references must point to an Object instance method, and take as argument
a Bundle parameter.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
     BundleAdapterBuilder cbi(CbBundle add, CbBundle change, CbBundle remove);
 
-    <T> BundleAdapterBuilder cb(CbTypeComponentBundle<T> add);         
-    <T> BundleAdapterBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
remove);         
-    <T> BundleAdapterBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
change, CbTypeComponentBundle<T> remove);         
+    /**
+     * Sets a <code>callback instance</code> java8 method reference which is
invoked when a bundle is added. 
+     * The method reference must point to an Object instance method, and takes as arguments
a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
     BundleAdapterBuilder cbi(CbComponentBundle add);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added or removed. 
+     * The method references must point to an Object instance method, and take as argument
a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
     BundleAdapterBuilder cbi(CbComponentBundle add, CbComponentBundle remove);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added, changed or removed.
+     * The method references must point to an Object instance method, and take as argument
a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
     BundleAdapterBuilder cbi(CbComponentBundle add, CbComponentBundle change, CbComponentBundle
remove);
 }

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/BundleDependencyBuilder.java
Thu Jan 28 21:32:55 2016
@@ -11,32 +11,23 @@ import org.apache.felix.dm.lambda.callba
 import org.osgi.framework.Bundle;
 
 /**
- * Builder for a DependencyManager <code>BundleDependency</code>.
- * TODO: add javadocs
+ * Builder for a DM Bundle Dependency.
+ * 
+ * Example that uses a Bundle Dependency:
+ * 
+ * <blockquote><pre>
+ * public class Activator extends DependencyActivatorBase {
+ *     public void init() throws Exception { 
+ *         component(comp -> comp
+ *             .impl(MyComponent.class)
+ *             .withBundle(b -> b.filter("(Bundle-SymbolicName=" + BSN + ")").cb(MyComponent::add,
MyComponent::remove))
+ *                  
+ *    }
+ * } </pre></blockquote>
  * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface BundleDependencyBuilder extends DependencyBuilder<BundleDependency>
{
-    
-    BundleDependencyBuilder cb(String ... callbacks);
-    BundleDependencyBuilder cb(Object callbackInstance, String ... callbacks);
-
-    <T> BundleDependencyBuilder cb(CbTypeBundle<T> add);
-    <T> BundleDependencyBuilder cb(CbTypeBundle<T> add, CbTypeBundle<T>
remove);
-    <T> BundleDependencyBuilder cb(CbTypeBundle<T> add, CbTypeBundle<T>
change, CbTypeBundle<T> remove);
-    
-    <T> BundleDependencyBuilder cb(CbTypeComponentBundle<T> add); 
-    <T> BundleDependencyBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
remove); 
-    <T> BundleDependencyBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
change, CbTypeComponentBundle<T> remove); 
- 
-    BundleDependencyBuilder cbi(CbBundle add);
-    BundleDependencyBuilder cbi(CbBundle add, CbBundle remove);
-    BundleDependencyBuilder cbi(CbBundle add, CbBundle change, CbBundle remove);
-
-    BundleDependencyBuilder cbi(CbComponentBundle add);
-    BundleDependencyBuilder cbi(CbComponentBundle add, CbComponentBundle remove);
-    BundleDependencyBuilder cbi(CbComponentBundle add, CbComponentBundle change, CbComponentBundle
remove);
-
     /**
      * Enables auto configuration for this dependency. This means the component implementation
(composition) will be
      * injected with this bundle dependency automatically.
@@ -134,5 +125,148 @@ public interface BundleDependencyBuilder
      * @return this service dependency. builder
      */
     public BundleDependencyBuilder propagate(Supplier<Dictionary<?, ?>> instance);
+
+    /**
+     * Sets some <code>callback</code> methods to invoke on the component instance(s).
When a bundle state matches the bundle 
+     * adapter filter, then the bundle is injected using the specified callback methods.
When you specify one callback, it stands for the "add" callback.
+     * When you specify two callbacks, the first one corresponds to the "add" callback, and
the second one to the "remove" callback. When you specify three
+     * callbacks, the first one stands for the "add" callback, the second one for the "change"
callback, and the third one for the "remove" callback.
+     * 
+     * @param callbacks a list of callbacks (1 param -> "add", 2 params -> "add"/remove",
3 params -> "add"/"change"/"remove" callbacks).
+     * @return this builder
+     */
+    BundleDependencyBuilder cb(String ... callbacks);
+    
+    /**
+     * Sets some <code>callback instance</code> methods to invoke on a given
Object instance. When a bundle state matches the bundle 
+     * adapter filter, then the bundle is injected using the specified callback methods.
When you specify one callback, it stands for the "add" callback.
+     * When you specify two callbacks, the first one corresponds to the "add" callback, and
the second one to the "remove" callback. 
+     * When you specify three callbacks, the first one stands for the "add" callback, the
second one for the "change" callback, and the third one for 
+     * the "remove" callback.
+     * 
+     * @param callbackInstance the Object instance where the callbacks are invoked on
+     * @param callbacks a list of callbacks (1 param -> "add", 2 params -> "add"/remove",
3 params -> "add"/"change"/"remove" callbacks).
+     * @return this builder
+     */
+    BundleDependencyBuilder cb(Object callbackInstance, String ... callbacks);
+
+    /**
+     * Sets a <code>callback</code> java8 method reference which is invoked when
a bundle is added.
+     * The method reference must point to a Component implementation class method, and take
as argument a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
+    <T> BundleDependencyBuilder cb(CbTypeBundle<T> add);
     
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    <T> BundleDependencyBuilder cb(CbTypeBundle<T> add, CbTypeBundle<T>
remove);
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, changed or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    <T> BundleDependencyBuilder cb(CbTypeBundle<T> add, CbTypeBundle<T>
change, CbTypeBundle<T> remove);
+    
+    /**
+     * Sets a <code>callback</code> java8 method reference which is invoked when
a bundle is added.
+     * The method reference must point to a Component implementation class method, and take
as argument a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
+    <T> BundleDependencyBuilder cb(CbTypeComponentBundle<T> add); 
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    <T> BundleDependencyBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
remove); 
+    
+    /**
+     * Sets some <code>callback</code> java8 method references which are invoked
when a bundle is added, changed or removed.
+     * The method references must point to a Component implementation class method, and take
as argument a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    <T> BundleDependencyBuilder cb(CbTypeComponentBundle<T> add, CbTypeComponentBundle<T>
change, CbTypeComponentBundle<T> remove); 
+ 
+    /**
+     * Sets a <code>callback instance</code> java8 method reference which is
invoked when a bundle is added. 
+     * The method reference must point to an Object instance method, and takes as argument
a Bundle parameter.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
+    BundleDependencyBuilder cbi(CbBundle add);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added or removed. 
+     * The method references must point to an Object instance method, and take as argument
a Bundle parameter.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    BundleDependencyBuilder cbi(CbBundle add, CbBundle remove);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added, changed or removed.
+     * The method references must point to an Object instance method, and take as argument
a Bundle parameter.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    BundleDependencyBuilder cbi(CbBundle add, CbBundle change, CbBundle remove);
+
+    /**
+     * Sets a <code>callback instance</code> java8 method reference which is
invoked when a bundle is added. 
+     * The method reference must point to an Object instance method, and takes as arguments
a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @return this builder
+     */
+    BundleDependencyBuilder cbi(CbComponentBundle add);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added or removed. 
+     * The method references must point to an Object instance method, and take as argument
a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    BundleDependencyBuilder cbi(CbComponentBundle add, CbComponentBundle remove);
+    
+    /**
+     * Sets some <code>callback instance</code> java8 method references which
are invoked when a bundle is added, changed or removed.
+     * The method references must point to an Object instance method, and take as argument
a Component and a Bundle.
+     * 
+     * @param add the method reference invoked when a bundle is added.
+     * @param change the method reference invoked when a bundle has changed.
+     * @param remove the method reference invoked when a bundle is removed.
+     * @return this builder
+     */
+    BundleDependencyBuilder cbi(CbComponentBundle add, CbComponentBundle change, CbComponentBundle
remove);    
 }

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyActivatorBase.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyActivatorBase.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyActivatorBase.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyActivatorBase.java
Thu Jan 28 21:32:55 2016
@@ -21,6 +21,7 @@ import org.osgi.framework.BundleContext;
  * Defines a base for Activators in order to build DependencyManager Components using a java8
style.<p>
  * 
  * Code example using auto configured fields:
+ * 
  * <pre> {@code
  * 
  * import static org.apache.felix.dm.builder.lambda.DependencyActivatorBase.*;

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
Thu Jan 28 21:32:55 2016
@@ -1,7 +1,5 @@
 package org.apache.felix.dm.lambda;
 
-import java.util.function.Consumer;
-
 /**
  * Defines the interface for a DependencyManager adapter builder.
  * The adapter will be applied to any service that matches the specified interface and filter.
For each matching service an adapter will be created 

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
Thu Jan 28 21:32:55 2016
@@ -1,7 +1,5 @@
 package org.apache.felix.dm.lambda;
 
-import java.util.function.Consumer;
-
 /**
  * Defines the interface for a DependencyManager aspect builder.
  * The aspect will be applied to any service that matches the specified interface and filter.
For each matching service an aspect will be created based 

Modified: felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/BundleAdapterBuilderImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/BundleAdapterBuilderImpl.java?rev=1727440&r1=1727439&r2=1727440&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/BundleAdapterBuilderImpl.java
(original)
+++ felix/sandbox/pderop/dependencymanager-lambda/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/BundleAdapterBuilderImpl.java
Thu Jan 28 21:32:55 2016
@@ -89,10 +89,10 @@ public class BundleAdapterBuilderImpl im
     }
 
     public BundleAdapterBuilder cb(String ... callbacks) {
-        return cb(null, callbacks);
+        return cbi(null, callbacks);
     }
     
-    public BundleAdapterBuilder cb(Object callbackInstance, String ... callbacks) {
+    public BundleAdapterBuilder cbi(Object callbackInstance, String ... callbacks) {
         switch (callbacks.length) {
         case 1:
             return cbi(callbackInstance, callbacks[0], null, null);



Mime
View raw message