Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,424 @@
+package org.apache.felix.dm.lambda;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.DependencyManager;
+import org.apache.felix.dm.lambda.impl.BundleAdapterBuilderImpl;
+import org.apache.felix.dm.lambda.impl.BundleDependencyBuilderImpl;
+import org.apache.felix.dm.lambda.impl.CompletableFutureDependencyImpl;
+import org.apache.felix.dm.lambda.impl.ComponentBuilderImpl;
+import org.apache.felix.dm.lambda.impl.ConfigurationDependencyBuilderImpl;
+import org.apache.felix.dm.lambda.impl.FactoryPidAdapterBuilderImpl;
+import org.apache.felix.dm.lambda.impl.ServiceAdapterBuilderImpl;
+import org.apache.felix.dm.lambda.impl.ServiceAspectBuilderImpl;
+import org.apache.felix.dm.lambda.impl.ServiceDependencyBuilderImpl;
+import org.osgi.framework.BundleActivator;
+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.*;
+ *
+ * public class Activator extends DependencyManagerActivator {    
+ *     public void activate() throws Exception {
+ *         component(comp -> comp
+ *             .provides(Service.class, property -> "value")
+ *             .impl(ServiceImpl.class)            
+ *             .withSrv(LogService.class, ConfigurationAdmni.class) // both 
services are required and injected in class fields with compatible types.       
    
+ *     }
+ * }
+ * }</pre>
+ *
+ * Code example using reflection callbacks:
+ * 
+ * <pre> {@code
+ * import static org.apache.felix.dm.builder.lambda.DependencyActivatorBase.*;
+ *
+ * public class Activator extends DependencyManagerActivator {    
+ *     public void activate() throws Exception {
+ *         component(comp -> comp
+ *             .provides(Service.class, property -> "value")
+ *             .impl(ServiceImpl.class)            
+ *             .withSrv(LogService.class, log -> log.cb("setLog"))             
 
+ *             .withSrv(ConfigurationAdmni.class, cm -> 
cm.cb("setConfigAdmin")))                
+ *     }
+ * }
+ * }</pre>
+ *
+ * Code example using method references:
+ * 
+ * <pre> {@code
+ * import static org.apache.felix.dm.lambda.DependencyActivatorBase.*;
+ *
+ * public class Activator extends DependencyManagerActivator {    
+ *     public void activate() throws Exception {
+ *         component(comp -> comp
+ *             .provides(Service.class, property -> "value")
+ *             .impl(ServiceImpl.class)            
+ *             .withSrv(LogService.class, log -> log.cb(ServiceImpl::setLog))  
            
+ *             .withSrv(ConfigurationAdmni.class, cm -> 
cm.cb(ServiceImpl::setConfigAdmin)))                
+ *     }
+ * }
+ * }</pre>
+ */
+public abstract class DependencyManagerActivator implements BundleActivator {  
  
+       /**
+        * DependencyManager object used to create/register real DM Components 
that are built by this activator.
+        */
+    protected DependencyManager m_manager;
+    
+    /**
+     * Bundle Context asociated to the activator bundle.
+     */
+    protected BundleContext m_ctx;
+
+    /**
+     * Our Activator is starting.
+     */
+    @Override
+    public void start(BundleContext context) throws Exception {
+        m_manager = new DependencyManager(context);
+        m_ctx = context;
+        activate();
+    }
+
+    /**
+     * Our Activator is stopped.
+     */
+    @Override
+    public void stop(BundleContext context) throws Exception {
+        deactivate();
+    }
+
+    /**
+     * Sub classes must override this method in order to build some DM 
components.
+     * @throws Exception if the activation fails
+     */
+    protected abstract void activate() throws Exception;
+
+    /**
+     * Sub classes may override this method that is called when the Activator 
is stopped.
+     * @throws Exception if the deactivation fails
+     */
+    protected void deactivate() throws Exception {
+    }
+    
+    /**
+     * Returns the DependencyManager used to create/managed DM Components.
+     * 
+     * @return the DependencyManager associated to this Activator
+     */
+    protected DependencyManager getDependencyManager() {
+        return m_manager;
+    }
+    
+    /**
+     * Returns the bundle context that is associated with this bundle.
+     * 
+     * @return the bundle context
+     */
+    protected BundleContext getBundleContext() {
+        return m_ctx;
+    }
+    
+    /**
+     * Creates a Component builder that can be used to create a DM Component. 
+     * @return a Component builder that can be used to create a DM Component.
+     */
+    protected ComponentBuilder<?> component() {
+        return new ComponentBuilderImpl(m_manager);
+    }
+    
+    /**
+     * Creates a service Aspect builder that can be used to create a DM Aspect 
Component.
+     * 
+     * @param <T> the aspect service type
+     * @param aspectType the aspect service
+     * @return a service Aspect builder.
+     */
+    protected <T> ServiceAspectBuilder<T> aspect(Class<T> aspectType) {
+        ServiceAspectBuilderImpl<T> aspectBuilder = new 
ServiceAspectBuilderImpl<>(m_manager, aspectType);
+        return aspectBuilder;
+    }
+    
+    /**
+     * Creates a service Adapter builder that can be used to create a DM 
Adapter Component. 
+     *
+     * @param <T> the adapted service type.
+     * @param adaptee the adapted service
+     * @return a service Adapter builder.
+     */
+    protected <T> ServiceAdapterBuilder<T> adapter(Class<T> adaptee) {
+        ServiceAdapterBuilderImpl<T> adapterBuilder = new 
ServiceAdapterBuilderImpl<>(m_manager, adaptee);
+        return adapterBuilder;
+    }
+    
+    /**
+     * Builds a DM Component using a Java8 style ComponentBuilder.
+     * @param consumer the lambda that will use the ComponentBuilder for 
building the DM component. 
+     * The component is auto-added to the DependencyManager, unless the lambda 
calls the ComponentBuilder.autoAdd(false) method.
+     * @return a newly built DM component.
+     */
+    protected Component component(Consumer<ComponentBuilder<?>> consumer) {
+        return component(m_manager, consumer);
+    }
+        
+    /**
+     * Builds a DM Aspect Component using a Java8 style AspectBuilder.
+     * The component is auto-added to the DependencyManager, unless the lambda 
calls the AspectBuilder.autoAdd(false) method.
+     *
+     * @param <T> the aspect service type
+     * @param aspect the aspect service
+     * @param consumer the lambda that will use the AspectBuilder for building 
the DM aspect component. 
+     * @return the DM component build by the consumer of the aspect builder
+     */
+    protected <T> Component aspect(Class<T> aspect, 
Consumer<ServiceAspectBuilder<T>> consumer) {
+        return aspect(m_manager, aspect, consumer);
+    }
+
+    /**
+     * Builds a DM Adapter Component using a Java8 style AdapterBuilder.
+     * The component is auto-added to the DependencyManager, unless the lambda 
calls the AdapterBuilder.autoAdd(false) method.
+     * 
+     * @param <T> the adapted service type
+     * @param adaptee the adapted service
+     * @param consumer the lambda that will use the AdapterBuilder for 
building the DM adapter component. 
+     * @return a newly built DM component.
+     */
+    protected <T> Component adapter(Class<T> adaptee, 
Consumer<ServiceAdapterBuilder<T>> consumer) {
+        return adapter(m_manager, adaptee, consumer);
+    }
+    
+    /**
+     * Builds a DM Factory Configuration Adapter Component using a Java8 style 
FactoryPidAdapterBuilder.
+     * The component is auto-added to the DependencyManager, unless the lambda 
calls the FactoryPidAdapterBuilder.autoAdd(false) method.
+     *
+     * @param consumer the lambda that will use the FactoryPidAdapterBuilder 
for building the DM factory configuration adapter component. 
+     * @return a newly built DM component.
+     */
+    protected Component factoryPidAdapter(Consumer<FactoryPidAdapterBuilder> 
consumer) {
+        return factoryPidAdapter(m_manager, consumer);
+    }
+
+    /**
+     * Builds a DM Bundle Adapter Component.
+     * @param consumer the lambda used to build the actual bundle adapter. 
+     * The component is auto-added to the DependencyManager, unless the lambda 
calls the BundleAdapter.autoAdd(false) method.
+     * @return a newly built DM component.
+     */
+    protected Component bundleAdapter(Consumer<BundleAdapterBuilder> consumer) 
{
+        return bundleAdapter(m_manager, consumer);
+    }
+       
+    // These static methods can be used when building DM components outside of 
an activator.
+       
+    /**
+     * Creates a Component builder that can be used to create a Component. 
+     * 
+     * @param dm the DependencyManager object used to create the component 
builder
+     * @return a Component builder that can be used to create a Component.
+     */
+    public static ComponentBuilder<?> component(DependencyManager dm) {
+        return new ComponentBuilderImpl(dm);
+    }
+    
+    /**
+     * Creates a service Aspect builder that can be used to create an Aspect 
Component. 
+     *
+     * @param <T> the aspect service type
+     * @param dm the DependencyManager object used to register the built 
component
+     * @param aspect the type of the aspect service
+     * @return a service Aspect builder that can be used to create an Aspect 
Component.
+     */
+    public static <T> ServiceAspectBuilder<T> aspect(DependencyManager dm, 
Class<T> aspect) {
+        ServiceAspectBuilderImpl<T> aspectBuilder = new 
ServiceAspectBuilderImpl<>(dm, aspect);
+        return aspectBuilder;
+    }
+    
+    /**
+     * Creates a service Adapter builder that can be used to create an Adapter 
Component.
+     * 
+     * @param <T> the adapted service type
+     * @param dm the DependencyManager object used to register the built 
component
+     * @param adaptee the type of the adaptee service
+     * @return a service Adapter builder that can be used to create an Adapter 
Component.
+     */
+    public static <T> ServiceAdapterBuilder<T> adapter(DependencyManager dm, 
Class<T> adaptee) {
+        ServiceAdapterBuilderImpl<T> adapterBuilder = new 
ServiceAdapterBuilderImpl<>(dm, adaptee);
+        return adapterBuilder;
+    }
+
+    /**
+     * Creates a factory pid adapter that can be used to create a factory 
adapter Component. 
+     * @param dm the DependencyManager object used to register the built 
component
+     * @return a factory pid adapter that can be used to create a factory 
adapter Component. 
+     */
+    public static FactoryPidAdapterBuilder factoryPidAdapter(DependencyManager 
dm) {
+        return new FactoryPidAdapterBuilderImpl(dm);
+    }
+   
+    /**
+     * Creates a bundle adapter builder that can be used to create a DM bundle 
adapter Component. 
+     *
+     * @param dm the DependencyManager object used to create the bundle 
adapter builder.
+     * @return a bundle adapter builder that can be used to create a DM bundle 
adapter Component.
+     */
+    public static BundleAdapterBuilder bundleAdapter(DependencyManager dm) {
+        return new BundleAdapterBuilderImpl(dm);
+    }
+   
+    /**
+     * Creates a DM ServiceDependency builder.
+     *
+     * @param <T> the service dependency type
+     * @param component the component on which you want to build a new service 
dependency using the returned builder
+     * @param service the service dependency type.
+     * @return a DM ServiceDependency builder.
+     */
+    public static <T> ServiceDependencyBuilder<T> serviceDependency(Component 
component, Class<T> service) {
+        return new ServiceDependencyBuilderImpl<>(component, service);
+    }
+    
+    /**
+     * Creates a DM Configuration Dependency builder.
+     * 
+     * @param component the component on which you want to build a new 
configuration dependency using the returned builder
+     * @return a DM Configuration Dependency builder.
+     */
+    public static ConfigurationDependencyBuilder confDependency(Component 
component) {
+        return new ConfigurationDependencyBuilderImpl(component);
+    }
+    
+    /**
+     * Creates a DM Bundle Dependency builder.
+     * 
+     * @param component the component on which you want to build a new bundle 
dependency using the returned builder
+     * @return a DM Configuration Dependency builder.
+     */
+    public static BundleDependencyBuilder bundleDependency(Component 
component) {
+        return new BundleDependencyBuilderImpl(component);
+    }
+
+    /**
+     * Creates a DM CompletableFuture Dependency builder.
+     *
+     * @param <F> the type of the CompletableFuture result.
+     * @param component the component on which you want to build a new 
completable future dependency using the returned builder.
+     * @param future the future the dependency built using the returned 
builder will depend on.
+     * @return a CompletableFuture dependency builder.
+     */
+    public static <F> FutureDependencyBuilder<F> futureDependency(Component 
component, CompletableFuture<F> future) {
+        return new CompletableFutureDependencyImpl<>(component, future);
+    }
+
+    /**
+     * Builds a component using a lambda and a component builder
+     * @param dm the DependencyManager where the component is auto-added 
(unless the component.autoAdd(false) is called)
+     * @param consumer a lambda that is called to build the component. When 
the lambda is called, it will be provided with a 
+     * ComponentBuilder object that is used to build the actual DM component.
+     * 
+     * @return the built DM component.
+     */
+    public static Component component(DependencyManager dm, 
Consumer<ComponentBuilder<?>> consumer) {
+        ComponentBuilder<?> componentBuilder = new ComponentBuilderImpl(dm);
+        consumer.accept(componentBuilder);
+        Component comp = componentBuilder.build();
+        if (((ComponentBuilderImpl) componentBuilder).isAutoAdd()) {
+               dm.add(comp);
+        }
+        return comp;
+    }
+
+    /**
+     * Update an existing component. Typically, this method can be used from a 
Component.init method, where more dependencies has to be added.
+     * @param comp an existing DM component
+     * @param consumer the lambda that will be used to update the component
+     */
+    public static void component(Component comp, Consumer<ComponentBuilder<?>> 
consumer) {
+        ComponentBuilder<?> componentBuilder = new ComponentBuilderImpl(comp, 
true /* update component */);
+        consumer.accept(componentBuilder);
+        componentBuilder.build();
+    }
+    
+    /**
+     * Builds an aspect DM Component.
+     * 
+     * @param <T> the aspect service type
+     * @param dm the DependencyManager object used to register the built 
component
+     * @param aspect the type of the aspect service
+     * @param consumer a lambda used to build the DM aspect component
+     * @return a new DM aspect component. The aspect component is auto-added 
into the dm object, unless the lambda calls
+     * the AspectBuilder.autoAdd(false) method.
+     */
+    public static <T> Component aspect(DependencyManager dm, Class<T> aspect, 
Consumer<ServiceAspectBuilder<T>> consumer) {
+        ServiceAspectBuilderImpl<T> aspectBuilder = new 
ServiceAspectBuilderImpl<>(dm, aspect);
+        consumer.accept(aspectBuilder);
+        Component comp = aspectBuilder.build();
+        if (aspectBuilder.isAutoAdd()) {
+               dm.add(comp);
+        }
+        return comp;
+    }    
+        
+    /**
+     * Builds an adapter DM Component.
+     * 
+     * @param <T> the adapted service type
+     * @param dm the DependencyManager object used to register the built 
component
+     * @param adaptee the type of the adapted service
+     * @param consumer a lambda used to build the DM adapter component
+     * @return a new DM adapter component. The adapter component is auto-added 
into the dm object, unless the lambda calls
+     * the AspectBuilder.autoAdd(false) method is called.
+     */
+    public static <T> Component adapter(DependencyManager dm, Class<T> 
adaptee, Consumer<ServiceAdapterBuilder<T>> consumer) {
+        ServiceAdapterBuilderImpl<T> adapterBuilder = new 
ServiceAdapterBuilderImpl<>(dm, adaptee);
+        consumer.accept(adapterBuilder);
+        Component comp = adapterBuilder.build();
+        if (adapterBuilder.isAutoAdd()) {
+               dm.add(comp);
+        }
+        return comp;
+    }
+      
+    /**
+     * Builds a bundle adapter DM Component.
+     * 
+     * @param dm the DependencyManager object used to register the built 
component
+     * @param consumer a lambda used to build the bundle adapter component
+     * @return a new bundle adapter component. The adapter component is 
auto-added into the dm object, unless the lambda calls
+     * the AspectBuilder.autoAdd(false) method is called.
+     */
+    public static Component bundleAdapter(DependencyManager dm, 
Consumer<BundleAdapterBuilder> consumer) {
+        BundleAdapterBuilderImpl adapterBuilder = new 
BundleAdapterBuilderImpl(dm);
+        consumer.accept(adapterBuilder);
+        Component comp = adapterBuilder.build();
+        if (adapterBuilder.isAutoAdd()) {
+            dm.add(comp);
+        }
+        return comp;
+    }
+
+    /**
+     * Builds a DM factory configuration adapter.
+     * @param dm the DependencyManager object used to create DM components.
+     * @param consumer a lambda used to build the DM factory configuration 
adapter component
+     * @return a new DM factory configuration adapter component. The adapter 
component is auto-added into the dm object, unless the lambda calls
+     * the FactoryPidAdapterBuilder.autoAdd(false) method is called
+     */
+    public static Component factoryPidAdapter(DependencyManager dm, 
Consumer<FactoryPidAdapterBuilder> consumer) {
+        FactoryPidAdapterBuilderImpl factoryPidAdapter = new 
FactoryPidAdapterBuilderImpl(dm);
+        consumer.accept(factoryPidAdapter);
+        Component comp = factoryPidAdapter.build();
+        if (factoryPidAdapter.isAutoAdd()) {
+               dm.add(comp);
+        }
+        return comp;
+    }
+}

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FactoryPidAdapterBuilder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FactoryPidAdapterBuilder.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FactoryPidAdapterBuilder.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FactoryPidAdapterBuilder.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,120 @@
+package org.apache.felix.dm.lambda;
+
+import org.apache.felix.dm.lambda.callbacks.CbComponentDictionary;
+import org.apache.felix.dm.lambda.callbacks.CbDictionary;
+import org.apache.felix.dm.lambda.callbacks.CbTypeComponentDictionary;
+import org.apache.felix.dm.lambda.callbacks.CbTypeDictionary;
+
+/**
+ * Builds a Dependency Manager Factory Configuration Adapter Component. For 
each new Config Admin factory configuration matching the factoryPid, 
+ * an adapter will be created based on the adapter implementation class. The 
adapter will be registered with the specified interface, 
+ * and with the specified adapter service properties. Depending on the 
propagate parameter, every public factory configuration properties 
+ * (which don't start with ".") will be propagated along with the adapter 
service properties.  
+ * 
+ * <p> Example that defines a factory configuration adapter service for the 
"foo.bar" factory pid:
+ * 
+ * <pre> {@code
+ * public class Activator extends DependencyManagerActivator {
+ *     public void activate() throws Exception { 
+ *         factoryPidAdapter(adapter -> adapter
+ *             .impl(DictionaryImpl.class)
+ *             .factoryPid("foo.bar").cb(ServiceImpl::updated)
+ *             .propagate()
+ *             .withSrv(LogService.class, log -> log.optional()));
+ *    }
+ * }
+ * }</pre>
+ */
+public interface FactoryPidAdapterBuilder extends 
ComponentBuilder<FactoryPidAdapterBuilder> {
+    /**
+     * Specifies the factory pid used by the adapter.
+     * @param pid the factory pid.
+     * @return this builder
+     */
+    FactoryPidAdapterBuilder factoryPid(String pid);
+    
+    /**
+     * Specifies a class name which fqdn represents the factory pid. Usually, 
this class can optionally be annotated with metatypes bnd annotations.
+     * @param pidClass the class that acts as the factory pid
+     * @return this builder
+     */
+    FactoryPidAdapterBuilder factoryPid(Class<?> pidClass);
+    
+    /**
+     * Specifies if the public properties (not starting with a dot) should be 
propagated in the adapter service properties (false by default).
+     * @return this builder.
+     */
+    FactoryPidAdapterBuilder propagate();
+    
+    /**
+     * Specifies if the public properties (not starting with a dot) should be 
propagated in the adapter service properties (false by default).
+     * @param propagate true if the public properties should be propagated in 
the adapter service properties (false by default).
+     * @return this builder.
+     */
+    FactoryPidAdapterBuilder propagate(boolean propagate);
+    
+    /**
+     * Specifies a callback method that will be called on the component 
instances when the configuration is injected
+     * @param updateMethod the method to call on the component instances when 
the configuration is available ("updated" by default).
+     * The following method signatures are supported:
+     * 
+     * <pre> {@code
+     *    method(Dictionary properties)
+     *    method(Component component, Dictionary properties)
+     * }</pre>
+     * 
+     * @return this builder
+     */
+    FactoryPidAdapterBuilder cb(String updateMethod);
+    
+    /**
+     * Specifies a callback instance method that will be called on a given 
object instance when the configuration is injected
+     * @param updateMethod the method to call on the given object instance 
when the configuration is available ("updated" by default).
+     * The following method signatures are supported:
+     * 
+     * <pre> {@code
+     *    method(Dictionary properties)
+     *    method(Component component, Dictionary properties)
+     * }</pre>
+     *
+     * @param callbackInstance the Object instance on which the updated 
callback will be invoked.
+     * @return this builder
+     */
+    FactoryPidAdapterBuilder cb(Object callbackInstance, String updateMethod);
+    
+    /**
+     * Specifies a callback method reference that will be called on one of the 
component classes when the configuration is injected.
+     * 
+     * @param <U> the type of the component implementation class on which the 
callback is invoked on.
+     * @param callback the method to call on one of the component classes when 
the configuration is available.
+     * @return this builder
+     */
+    <U> FactoryPidAdapterBuilder cb(CbTypeDictionary<U> callback);
+    
+    /**
+     * Specifies a callback method reference that will be called on one of the 
component classes when the configuration is injected
+     * 
+     * @param <U> the type of the component implementation class on which the 
callback is invoked on.
+     * @param callback the reference to a method on one of the component 
classes. The method may takes as parameter a Component and a Dictionary.
+     * @return this builder
+     */
+    <U> FactoryPidAdapterBuilder cb(CbTypeComponentDictionary<U> callback);
+    
+    /**
+     * Specifies a callback instance method reference that will be called on a 
given object instance when the configuration is injected
+     * 
+     * @param callback the method to call on a given object instance when the 
configuration is available. The callback takes as argument a
+     * a Dictionary parameter.
+     * @return this builder
+     */
+    FactoryPidAdapterBuilder cbi(CbDictionary callback);
+
+    /**
+     * Specifies a callback instance method reference that will be called on a 
given object instance when the configuration is injected.
+     * 
+     * @param callback the method to call on a given object instance when the 
configuration is available. The callback takes as argument a
+     * Dictionary parameter. 
+     * @return this builder
+     */
+    FactoryPidAdapterBuilder cbi(CbComponentDictionary callback);
+}

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperties.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperties.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperties.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperties.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,35 @@
+package org.apache.felix.dm.lambda;
+
+import org.apache.felix.dm.lambda.callbacks.SerializableLambda;
+
+/**
+ * Lambda allowing to define fluent service properties. Property names are 
deduces from the lambda parameter name.
+ * 
+ * <p> Example of a component which provides fluent properties ("foo=bar"; 
"foo2=Integer(123)):
+ * 
+ * <pre>{@code
+ * public class Activator extends DependencyManagerActivator {
+ *   public void activate() throws Exception {
+ *       component(comp -> 
comp.impl(MyComponentImpl.class).provides(MyService.class, foo->"bar", foo2 -> 
123));
+ *   }
+ * } 
+ * }</pre>
+ * 
+ * <b>Caution: Fluent properties requires the usage of the "-parameter" javac 
option.</b>
+ * 
+ * Under eclipse, you can enable this option using:
+ * 
+ * <pre>{@code
+ * Windows -> Preference -> Compiler -> Classfile Generation -> Store 
information about method parameters.
+ * }</pre>
+ */
+@FunctionalInterface
+public interface FluentProperties extends SerializableLambda {
+    /**
+     * Represents a fluent property
+     * 
+     * @param name the property name. The parameter used by the lambda will be 
intropsected and will be used as the actual property name.
+     * @return the property value
+     */
+    public Object apply(String name);
+}

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FutureDependencyBuilder.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,129 @@
+package org.apache.felix.dm.lambda;
+
+import java.util.concurrent.Executor;
+
+import org.apache.felix.dm.Dependency;
+import org.apache.felix.dm.lambda.callbacks.CbFuture;
+import org.apache.felix.dm.lambda.callbacks.CbTypeFuture;
+
+/**
+ * Defines a builder for a CompletableFuture dependency.
+ * Using such dependency allows your component to wait for the completion of a 
given asynchronous task
+ * represented by a standard jdk <code>CompletableFuture</code> object.
+ * 
+ * A FutureDependency is required and unblock the Component once the 
CompletableFuture result has completed.
+ * 
+ * <h3>Usage Example</h3>
+ * 
+ * <p> Here is an Activator that downloads a page from the web and injects the 
string result to a component.
+ * When the web page is downloaded, the result is injected in the 
MyComponent::setPage method and
+ * the component is then called in its "start" method:
+ * 
+ * <pre>{@code
+ * 
+ * public class Activator extends DependencyManagerActivator {
+ *   public void activate() throws Exception {         
+ *      String url = "http://felix.apache.org/";;
+ *      CompletableFuture<String> page = CompletableFuture.supplyAsync(() -> 
downloadSite(url));                               
+ *
+ *      // The component depends on a log service and on the content of the 
Felix site.
+ *      // The lambda passed to the "withFuture" method configures the 
callback that is 
+ *      // invoked with the result of the CompletableFuture (the page content).
+ *      component(comp -> comp
+ *          .impl(MyComponent.class)
+ *          .withService(LogService.class)
+ *          .withFuture(page, result -> result.cb(MyComponent::setPage)));
+ *   }
+ * }
+ * 
+ * public class MyComponent {
+ *   volatile LogService log; // injected.
+ *   
+ *   void setPage(String page) {
+ *      // injected by the FutureDependency.
+ *   }
+ *   
+ *   void start() {
+ *      // all required dependencies injected.
+ *   }
+ * }
+ * 
+ * }</pre>
+ * 
+ * @param <F> the type of the CompletableFuture result.
+ */
+public interface FutureDependencyBuilder<F> extends 
DependencyBuilder<Dependency> { 
+    /**
+     * Sets the callback method name to invoke on the component instances, 
once the CompletableFuture has completed.
+     * @param callback the callback method name to invoke on the component 
instances, once the CompletableFuture on which we depend has completed.
+     * @return this dependency.
+     */
+    FutureDependencyBuilder<F> cb(String callback);
+    
+    /**
+     * Sets the function to invoke when the future task has completed. The 
function is from one of the Component implementation classes, and it accepts the
+     * result of the completed future.
+     * 
+     * @param <T> the type of the CompletableFuture result.
+     * @param callback the function to perform when the future task as 
completed. 
+     * @return this dependency
+     */
+    <T> FutureDependencyBuilder<F> cb(CbTypeFuture<T, ? super F> callback);
+    
+    /**
+     * Sets the function to invoke asynchronously when the future task has 
completed. The function is from one of the Component implementation classes, 
+     * and it accepts the result of the completed future.
+     * 
+     * @param <T> the type of the CompletableFuture result.
+     * @param callback the function to perform when the future task as 
completed.
+     * @param async true if the callback should be invoked asynchronously 
using the default jdk execution facility, false if not.
+     * @return this dependency
+     */
+    <T> FutureDependencyBuilder<F> cb(CbTypeFuture<T, ? super F> callback, 
boolean async);
+
+    /**
+     * Sets the function to invoke asynchronously when the future task has 
completed. The function is from one of the Component implementation classes, 
+     * and it accepts the result of the completed future.
+     * 
+     * @param <T> the type of the CompletableFuture result.
+     * @param callback the function to perform when the future task as 
completed. 
+     * @param executor the executor used to schedule the callback.
+     * @return this dependency
+     */
+    <T> FutureDependencyBuilder<F> cb(CbTypeFuture<T, ? super F> callback, 
Executor executor);   
+        
+    /**
+     * Sets the callback instance method name to invoke on a given Object 
instance, once the CompletableFuture has completed.
+     * @param callbackInstance the object instance on which the callback must 
be invoked
+     * @param callback the callback method name to invoke on Object instance, 
once the CompletableFuture has completed.
+     * @return this dependency.
+     */
+    FutureDependencyBuilder<F> cbi(Object callbackInstance, String callback);
+    
+    /**
+     * Sets the callback instance to invoke when the future task has 
completed. The callback is a Consumer instance which accepts the
+     * result of the completed future.
+     * @param callback a Consumer instance which accepts the result of the 
completed future.
+     * @return this dependency
+     */
+    FutureDependencyBuilder<F> cbi(CbFuture<? super F> callback);
+    
+    /**
+     * Sets the callback instance to invoke when the future task has 
completed. The callback is a Consumer instance which accepts the
+     * result of the completed future.
+     * 
+     * @param callback a Consumer instance which accepts the result of the 
completed future.
+     * @param async true if the callback should be invoked asynchronously 
using the default jdk execution facility, false if not.
+     * @return this dependency
+     */
+    FutureDependencyBuilder<F> cbi(CbFuture<? super F> callback, boolean 
async);
+
+    /**
+     * Sets the callback instance to invoke when the future task has 
completed. The callback is a Consumer instance which accepts the
+     * result of the completed future.
+     * @param callback the action to perform when the future task as 
completed. 
+     * @param executor the executor to use for asynchronous execution of the 
callback.
+     * @return this dependency
+     */
+    FutureDependencyBuilder<F> cbi(CbFuture<? super F> callback, Executor 
executor);   
+}

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAdapterBuilder.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,59 @@
+package org.apache.felix.dm.lambda;
+
+/**
+ * Builds a Dependency Manager Service Adapter Component.
+ * The adapter will be applied to any service that matches the specified 
interface and filter. For each matching service an adapter will be created 
+ * based on the adapter implementation class. The adapter will be registered 
with the specified interface and existing properties from the original 
+ * service plus any extra properties you supply here.<p>
+ * 
+ * Code example that adapts a "Device" service to an HttpServlet service. The 
adapter is created using a ServiceAdapterBuilder that is passed to the lambda. 
+ * 
+ * <pre> {@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception { 
+ *        adapter(Device.class, adapt -> 
adapt.impl(DeviceServlet.class).provides(HttpServlet.class).properties(alias -> 
"/device");                    
+ *    }
+ * }}</pre>
+ * 
+ * @param <T> the adaptee service
+ */
+public interface ServiceAdapterBuilder<T> extends 
ComponentBuilder<ServiceAdapterBuilder<T>>, ServiceCallbacksBuilder<T, 
ServiceAdapterBuilder<T>> {
+    /**
+     * Specifies the filter used to match a given adapted service.
+     * 
+     * @param adapteeFilter the filter used to match a given adapted service
+     * @return this builder
+     */
+    ServiceAdapterBuilder<T> filter(String adapteeFilter);
+    
+    /**
+     * Specifies whether or not the adapted service properties must be 
propagated to the adapter service (true by default). 
+     * 
+     * @param propagate true if the adapted service properties must be 
propagated to the adapter service (true by default). 
+     * @return this builder
+     */
+    ServiceAdapterBuilder<T> propagate(boolean propagate);
+    
+    /**
+     * Injects this adapted service in all fields matching the adapted service 
type.
+     * 
+     * @return this builder
+     */
+    ServiceAdapterBuilder<T> autoConfig();
+    
+    /**
+     * Configures whether or not the adapted service can be injected in all 
fields matching the adapted service type. 
+     * 
+     * @param autoConfig true if the adapted service can be injected in all 
fields matching the adapted service type
+     * @return this builder
+     */
+    ServiceAdapterBuilder<T> autoConfig(boolean autoConfig);
+    
+    /**
+     * Injects this adapted service on the field matching the given name
+     * 
+     * @param field the field name where the adapted service must be injected 
to.
+     * @return this builder
+     */
+    ServiceAdapterBuilder<T> autoConfig(String field);        
+}

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceAspectBuilder.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,72 @@
+package org.apache.felix.dm.lambda;
+
+/**
+ * Builds a Dependency Manager Aspect Component.
+ * The aspect will be applied to any service that matches the specified 
interface and filter (if any). For each matching service an aspect will be 
created based 
+ * on the aspect implementation class. 
+ * The aspect will be registered with the same interface and properties as the 
original service, plus any extra properties you supply here.
+ * Multiple Aspects of the same service are chained and ordered using aspect 
ranks.
+ * 
+ * <p> Code example that provides a "LogService" aspect that performs 
spell-checking of each log message. 
+ * The aspect decorates a LogService. The aspect also depends on an Dictionary 
service that is internally used to perform log spell checking.
+ * The LogService and Dictionary services are injected in the aspect 
implementation using reflection on class fields:
+ * 
+ * <pre>{@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception { 
+ *       aspect(LogService.class, asp -> 
asp.impl(SpellCheckLogAspect.class).rank(10).withSrv(Dictionary.class));
+ *    }
+ * }} </pre>
+ *
+ * Same example, but using callbacks for injecting LogService and Dictionary 
services in the aspect implementation class:
+ * 
+ * <pre>{@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception { 
+ *       aspect(LogService.class, asp -> 
asp.impl(SpellCheckLogAspect.class).rank(10)
+ *          .cb(SpellCheckLogAspect::setLogService)
+ *          .withSrv(Dictionary.class, dict -> 
dict.cb(SpellCheckLogAspect::setDictionary)));
+ *    }
+ * }} </pre>
+ *
+ * @param <T> the aspect service
+ */
+public interface ServiceAspectBuilder<T> extends 
ComponentBuilder<ServiceAspectBuilder<T>>, ServiceCallbacksBuilder<T, 
ServiceAspectBuilder<T>> {
+    /**
+     * Specifies the aspect service filter. 
+     * 
+     * @param filter the filter condition to use with the service interface 
the aspect will apply on
+     * @return this builder
+     */
+    ServiceAspectBuilder<T> filter(String filter);
+    
+    /**
+     * Specifies the aspect ranking. Aspects of a given service are ordered by 
their ranking property.
+     * 
+     * @param ranking the aspect ranking
+     * @return this builder
+     */
+    ServiceAspectBuilder<T> rank(int ranking);
+    
+    /**
+     * Injects the aspect in all fields matching the aspect type.
+     * @return this builder
+     */
+    ServiceAspectBuilder<T> autoConfig();
+    
+    /**
+     * Configures whether or not the aspect service can be injected in all 
fields matching the aspect type.
+     *  
+     * @param autoConfig true if the aspect service can be injected in all 
fields matching the dependency type
+     * @return this builder
+     */
+    ServiceAspectBuilder<T> autoConfig(boolean autoConfig);
+    
+    /**
+     * Injects the aspect service on the field with the given name.
+     * 
+     * @param field the field name where the aspect service must be injected
+     * @return this builder
+     */
+    ServiceAspectBuilder<T> autoConfig(String field);     
+}

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceCallbacksBuilder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceCallbacksBuilder.java?rev=1727869&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceCallbacksBuilder.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ServiceCallbacksBuilder.java
 Sun Jan 31 23:27:05 2016
@@ -0,0 +1,799 @@
+package org.apache.felix.dm.lambda;
+
+import org.apache.felix.dm.lambda.callbacks.CbComponent;
+import org.apache.felix.dm.lambda.callbacks.CbComponentRef;
+import org.apache.felix.dm.lambda.callbacks.CbComponentRefService;
+import org.apache.felix.dm.lambda.callbacks.CbComponentRefServiceRefService;
+import org.apache.felix.dm.lambda.callbacks.CbComponentService;
+import org.apache.felix.dm.lambda.callbacks.CbComponentServiceService;
+import org.apache.felix.dm.lambda.callbacks.CbRef;
+import org.apache.felix.dm.lambda.callbacks.CbRefService;
+import org.apache.felix.dm.lambda.callbacks.CbRefServiceRefService;
+import org.apache.felix.dm.lambda.callbacks.CbService;
+import org.apache.felix.dm.lambda.callbacks.CbServiceDict;
+import org.apache.felix.dm.lambda.callbacks.CbServiceMap;
+import org.apache.felix.dm.lambda.callbacks.CbServiceService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeComponent;
+import org.apache.felix.dm.lambda.callbacks.CbTypeComponentRef;
+import org.apache.felix.dm.lambda.callbacks.CbTypeComponentRefService;
+import 
org.apache.felix.dm.lambda.callbacks.CbTypeComponentRefServiceRefService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeComponentService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeComponentServiceService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeRef;
+import org.apache.felix.dm.lambda.callbacks.CbTypeRefService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeRefServiceRefService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeService;
+import org.apache.felix.dm.lambda.callbacks.CbTypeServiceDict;
+import org.apache.felix.dm.lambda.callbacks.CbTypeServiceMap;
+import org.apache.felix.dm.lambda.callbacks.CbTypeServiceService;
+
+/**
+ * Builds a service dependency callback (required by default).
+ * 
+ * A Service may be injected in a bind-method of a component or an object 
instance using this builder.
+ * The builder supports the following kind of method signatures for bind 
methods:
+ * 
+ * <pre> {@code
+ * method(S service)
+ * method(S service, Map<String, Object> serviceProperties)
+ * method(S service, Dictionary<String, Object> serviceProperties)
+ * method(ServiceReference<S> serviceRef, S service),
+ * method(ServiceReference<S> serviceRef)
+ * method(Component serviceComponent)
+ * method(Component serviceComponent, ServiceReference<S> serviceRef)
+ * method(Component serviceComponent, S service) 
+ * method(Component serviceComponent, ServiceReference<S> serviceRef, S 
service)
+ * swapMethod(S oldService, S newService)
+ * swapMethod(ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S 
newService)
+ * swapMethod(Component component, S oldService, S newService)
+ * swapMethod(Component component, ServiceReference<S> oldRef, S old, 
ServiceReference<S> newRef, S newService)
+ * }</pre>
+ *
+ * The following families of callbacks are supported:
+ * 
+ * <ul>
+ * <li> "cb(String ... callback)": stands for "callback" and specifies a list 
of callbacks from the component instances. When using one arg, it stands for 
the "add" callback. 
+ * When using two args, it stands for "add/remove" callbacks. When using three 
args, it stands for "add/change/remove" callbacks. When using four args, it 
stands for "add/change/remove/swap" callbacks. 
+ * <li> "cbi(Object callbackInstance, String ... callbacks)": stands for 
"callback instance" and specifies some callbacks on a given object instance.
+ * <li> "cb(lambda) ": stands for "callback" and specifies a method reference 
of a callback from a given component class.
+ * <li> "cbi(lambda)": stands for "callback instance" and specifies a method 
reference from a given object instance.
+ * <li> "sw(lambda)":  stands for "swap callback" and specifies a method 
reference of a swap callback from a given component class.
+ * <li> "swi(lambda)": stands for "swap callback instance" and specifies a 
method reference of a swap callback from a given object instance.
+ * </ul>
+ *
+ * <p> Here is an example of a Component that defines a dependency of a 
LogService which is injected in the "bindLogService" method using a 
ServiceCallbacksBuilder:
+ * The withSrv(...)" declaration defines a method reference on the 
"ComponentImpl::bindLogService" method (using a lambda):
+ * 
+ * <pre> {@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception { 
+ *       component(comp -> 
comp.impl(ComponentImpl.class).withSrv(LogService.class, log -> 
log.cb(ComponentImpl::bindLogService)));
+ *    }
+ * }}</pre>
+ *
+ * <p> Same example, but we inject the dependency in an object instance that 
we already have in hand:
+ * 
+ * <pre> {@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception {
+ *       ComponentImpl impl = new ComponentImpl();
+ *       component(comp -> comp.impl(impl).withSrv(LogService.class, log -> 
log.cbi(impl::bindLogService)));
+ *    }
+ * }}</pre>
+ * 
+ * <p> Here, we inject a service using method reflection (as it is the case in 
original DM api):
+ * 
+ * <pre> {@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception {
+ *       component(comp -> 
comp.impl(ComponentImpl::class).withSrv(LogService.class, log -> 
log.cb("bindLogService")));
+ *    }
+ * }}</pre>
+ *
+ * <p> Same example, but we inject the dependency in an object instance that 
we already have in hand:
+ * 
+ * <pre> {@code
+ * public class Activator extends DependencyManagerActivator {
+ *    public void activate() throws Exception {
+ *       ComponentImpl impl = new ComponentImpl();
+ *       component(comp -> comp.impl(impl).withSrv(LogService.class, log -> 
log.cbi(impl, "bindLogService")));
+ *    }
+ * }}</pre>
+ *
+ * @param <S> the service dependency type
+ * @param <B> the type of a sub interface that may extends this interface.
+ * 
+ * @author <a href="mailto:[email protected]";>Felix Project Team</a>
+ */
+public interface ServiceCallbacksBuilder<S, B extends 
ServiceCallbacksBuilder<S, B>> {
+    /**
+     * Sets <code>callback</code> methods to invoke on the component 
instance(s). When a service matches the service 
+     * filter, then the service 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.
+     * When you specify four callbacks, it stands for 
"add"/"change"/"remove"/swap callbacks.
+     * 
+     * The following method signature are supported:
+     * <pre>{@code
+     * method(S service)
+     * method(S service, Map<String, Object> serviceProperties)
+     * method(S service, Dictionary<String, Object> serviceProperties)
+     * method(ServiceReference<S> serviceRef, S service),
+     * method(ServiceReference<S> serviceRef)
+     * method(Component serviceComponent)
+     * method(Component serviceComponent, ServiceReference<S> serviceRef)
+     * method(Component serviceComponent, S service) 
+     * method(Component serviceComponent, ServiceReference<S> serviceRef, S 
service)
+     * swapMethod(S oldService, S newService)
+     * swapMethod(ServiceReference<S> oldRef, S old, ServiceReference<S> 
newRef, S newService)
+     * swapMethod(Component component, S oldService, S newService)
+     * swapMethod(Component component, ServiceReference<S> oldRef, S old, 
ServiceReference<S> newRef, S newService)
+     * }</pre>
+     * 
+     * @param callbacks a list of callbacks (1 param: "add", 2 params: 
"add"/remove", 3 params: "add"/"change"/"remove", 4 params: 
"add"/"change"/"remove"/"swap" callbacks).
+     * @return this builder
+     */
+    B cb(String ... callbacks);
+    
+    /**
+     * Sets <code>callback instance</code> methods to invoke on a given Object 
instance. When a service matches the service 
+     * filter, then the service 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 on which the callback is invoked.
+     * @param callbacks a list of callbacks (1 param : "add", 2 params : 
"add"/remove", 3 params : "add"/"change"/"remove", 4 params : 
"add"/"change"/"remove"/"swap" callbacks).
+     * @see #cb(String...)
+     * @return this builder
+     */
+    B cbi(Object callbackInstance, String ... callbacks);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeService<T, S> add);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeService<T, S> add, CbTypeService<T, S> remove);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeService<T, S> add, CbTypeService<T, S> change, 
CbTypeService<T, S> remove);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service, and a properties map.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeServiceMap<T, S> add);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service, and a properties map.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeServiceMap<T, S> add, CbTypeServiceMap<T, S> remove);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service, and a properties map.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeServiceMap<T, S> add, CbTypeServiceMap<T, S> change, 
CbTypeServiceMap<T, S> remove);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service, and a properties dictionary.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeServiceDict<T, S> add);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service, and a properties dictionary.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeServiceDict<T, S> add, CbTypeServiceDict<T, S> remove);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service, and a properties dictionary.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeServiceDict<T, S> add, CbTypeServiceDict<T, S> change, 
CbTypeServiceDict<T, S> remove);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service reference, and the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeRefService<T, S> add);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service reference, and the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeRefService<T, S> add, CbTypeRefService<T, S> remove);
+ 
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service reference, and the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeRefService<T, S> add, CbTypeRefService<T, S> change, 
CbTypeRefService<T, S> remove);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service reference.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeRef<T, S> add);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service reference.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeRef<T, S> add, CbTypeRef<T, S> remove);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the service reference.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeRef<T, S> add, CbTypeRef<T, S> change, CbTypeRef<T, S> 
remove);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponent<T> add);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponent<T> add, CbTypeComponent<T> remove);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponent<T> add, CbTypeComponent<T> change, 
CbTypeComponent<T> remove);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, and the service reference.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentRef<T, S> add);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, and the service reference.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentRef<T, S> add, CbTypeComponentRef<T, S> remove);
+  
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, and the service reference.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentRef<T, S> add, CbTypeComponentRef<T, S> change, 
CbTypeComponentRef<T, S> remove);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, and the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentService<T, S> add);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, and the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentService<T, S> add, CbTypeComponentService<T, S> 
remove);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, and the service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentService<T, S> add, CbTypeComponentService<T, S> 
change, CbTypeComponentService<T, S> remove);
+
+    /**
+     * Sets a <code>callback</code> invoked when a service is added.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, the service Reference and the 
service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentRefService<T, S> add);
+ 
+    /**
+     * Sets a <code>callback</code> invoked when a service is added or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, the service Reference and the 
service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentRefService<T, S> add, CbTypeComponentRefService<T, 
S> remove);
+    
+    /**
+     * Sets a <code>callback</code> invoked when a service is added, changed, 
or removed.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the Component, the service Reference and the 
service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    <T> B cb(CbTypeComponentRefService<T, S> add, CbTypeComponentRefService<T, 
S> change, CbTypeComponentRefService<T, S> remove);
+
+    /**
+     * Sets a <code>swap callback(Service, Service)</code> invoked when a 
service is swapped.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the old service and the new replacing service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    <T> B sw(CbTypeServiceService<T, S> swap);
+ 
+    /**
+     * Sets a <code>swap callback(Component, Service, Service)</code> invoked 
when a service is swapped.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the component, the old service and the new 
replacing service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    <T> B sw(CbTypeComponentServiceService<T, S> swap);
+    
+    /**
+     * Sets a <code>swap callback(ServiceReference, Service, ServiceReference, 
Service)</code> invoked when a service is swapped.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the old service reference, the old service, the 
new service reference, and
+     * the new service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    <T> B sw(CbTypeRefServiceRefService<T, S> swap);
+    
+    /**
+     * Sets a swap <code>callback</code> invoked when a service is swapped.
+     * The method reference must point to a Component implementation class 
method. Callback argument(s): the component, the old service reference, the old 
service, the new service reference, and
+     * the new service.
+     * 
+     * @param <T> the type of the component instance class on which the 
callback is invoked.
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    <T> B sw(CbTypeComponentRefServiceRefService<T, S> swap);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbService<S> add);
+    
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbService<S> add, CbService<S> remove);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbService<S> add, CbService<S> change, CbService<S> remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a service and a properties Map.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbServiceMap<S> add);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service and a properties Map.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbServiceMap<S> add, CbServiceMap<S> remove);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service and a properties Map.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbServiceMap<S> add, CbServiceMap<S> change, CbServiceMap<S> remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a service and a properties Dictionary.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbServiceDict<S> add);
+   
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service and a properties Dictionary.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbServiceDict<S> add, CbServiceDict<S> remove);
+ 
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service and a properties Dictionary.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbServiceDict<S> add, CbServiceDict<S> change, CbServiceDict<S> 
remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a service reference and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbRefService<S> add);
+    
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service reference and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbRefService<S> add, CbRefService<S> remove);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service reference and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbRefService<S> add, CbRefService<S> change, CbRefService<S> remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a service reference.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbRef<S> add);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service reference.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbRef<S> add, CbRef<S> remove);
+    
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a service reference.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbRef<S> add, CbRef<S> change, CbRef<S> remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a Component.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbComponent add);
+    
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponent add, CbComponent remove);
+ 
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponent add, CbComponent change, CbComponent remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a Component and a service reference.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbComponentRef<S> add);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component and a service reference.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponentRef<S> add, CbComponentRef<S> remove);
+ 
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component and a service reference.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponentRef<S> add, CbComponentRef<S> change, CbComponentRef<S> 
remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a Component and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbComponentService<S> add);    
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponentService<S> add, CbComponentService<S> remove);
+   
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponentService<S> add, CbComponentService<S> change, 
CbComponentService<S> remove);
+
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is added.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): a Component, a service reference, and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @return this builder
+     */
+    B cbi(CbComponentRefService<S> add);
+   
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component, a service reference, and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponentRefService<S> add, CbComponentRefService<S> remove);
+  
+    /**
+     * Sets a <code>callback instance</code> invoked when a service is 
added/changed/removed.
+     * The method reference must point to method from an Object instance. 
Callback argument(s): a Component, a service reference, and a service.
+     * 
+     * @param add the method reference invoked when a service is added.
+     * @param change the method reference invoked when a service is changed.
+     * @param remove the method reference invoked when a service is removed.
+     * @return this builder
+     */
+    B cbi(CbComponentRefService<S> add, CbComponentRefService<S> change, 
CbComponentRefService<S> remove);
+    
+    /**
+     * Sets a swap <code>callback instance</code> invoked when a service is 
swapped.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): the old service, and the new service.
+     * the new service.
+     *
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    B swi(CbServiceService<S> swap);
+   
+    /**
+     * Sets a swap <code>callback instance</code> invoked when a service is 
swapped.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): the component, the old service, and the new service.
+     * the new service.
+     *
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    B swi(CbComponentServiceService<S> swap);
+  
+    /**
+     * Sets a swap <code>callback instance</code> invoked when a service is 
swapped.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): the old service reference, the old service, the 
+     * new service reference, and the new service.
+     *
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    B swi(CbRefServiceRefService<S> swap);
+  
+    /**
+     * Sets a swap <code>callback instance</code> invoked when a service is 
swapped.
+     * The method reference must point to a method from an Object instance. 
Callback argument(s): the component, old service reference, the old service, 
the 
+     * new service reference, and the new service.
+     *
+     * @param swap the method reference invoked when the service is swapped.
+     * @return this builder
+     */
+    B swi(CbComponentRefServiceRefService<S> swap);        
+}


Reply via email to