Author: pderop
Date: Tue Feb  2 19:46:08 2016
New Revision: 1728193

URL: http://svn.apache.org/viewvc?rev=1728193&view=rev
Log:
cleanup.

Added:
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperty.java
Removed:
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperties.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/test/org/
Modified:
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/Activator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/README
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/Activator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/PageLinksImpl.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/AdapterBase.java
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ComponentBuilderImpl.java

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/Activator.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/Activator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/compositefactory/Activator.java
 Tue Feb  2 19:46:08 2016
@@ -20,7 +20,9 @@ package org.apache.felix.dm.lambda.sampl
 
 import static java.lang.System.out;
 
+import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.lambda.DependencyManagerActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.log.LogService;
 
@@ -39,7 +41,7 @@ import org.osgi.service.log.LogService;
  */
 public class Activator extends DependencyManagerActivator {
     @Override
-    public void activate() throws Exception {
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception 
{
        out.println("type \"log info\" to see the logs emitted by this test.");
 
        // Create the Factory used to instantiate ProvuderImpl, 
ProviderComposite1 and ProviderComposite2

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/device/Activator.java
 Tue Feb  2 19:46:08 2016
@@ -20,7 +20,9 @@ package org.apache.felix.dm.lambda.sampl
 
 import static java.lang.System.out;
 
+import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.lambda.DependencyManagerActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.log.LogService;
 
 /**
@@ -28,7 +30,7 @@ import org.osgi.service.log.LogService;
  */
 public class Activator extends DependencyManagerActivator {
     @Override
-    public void activate() throws Exception { 
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception 
{ 
        out.println("type \"log info\" to see the logs emitted by this test.");
 
        // Create a pair of Device/DeviceParameter service with id=1

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/Activator.java
 Tue Feb  2 19:46:08 2016
@@ -20,7 +20,9 @@ package org.apache.felix.dm.lambda.sampl
 
 import static java.lang.System.out;
 
+import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.lambda.DependencyManagerActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.log.LogService;
 import static 
org.apache.felix.service.command.CommandProcessor.COMMAND_FUNCTION;
 import static org.apache.felix.service.command.CommandProcessor.COMMAND_SCOPE;
@@ -30,7 +32,7 @@ import static org.apache.felix.service.c
  */
 public class Activator extends DependencyManagerActivator {
     @Override
-    public void activate() throws Exception {
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception 
{
        out.println("type \"log info\" to see the logs emitted by this test.");
 
         // Create the factory configuration for our DictionaryImpl service. An 
instance of the DictionaryImpl is created for each

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/README
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/README?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/README
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/dictionary/README
 Tue Feb  2 19:46:08 2016
@@ -15,27 +15,27 @@
  * limitations under the License.
  */
 
-This sample shows a "SpellChecker" application (using DM API) which provides a
+This sample shows a "SpellChecker" application which provides a
 "dictionary:spellcheck" GOGO shell command. The GOGO "dictionary:spellcheck" 
command accepts a
-string as parameter, which is checked for proper existence. The SpellChecker 
class has a
+string as parameter, which is checked for proper exactness. The SpellChecker 
class has a
 required/multiple (1..N) dependency over every available "DictionaryService" 
services, which are
-internally used by the SpellChecker command, when checking word existence.
+internally used by the SpellChecker command, when checking word exactness.
 
 A DictionaryService is defined using a FactoryConfigurationAdapterService , 
allowing to instantiate
 many "DictionaryService" instances for each configuration that are added to the
-factory pid "Spell Checker Configuration (api)" from web console.
+factory pid "Spell Checker Configuration" from web console.
 The factory pid configuration metatypes are defined using the bnd "metatype" 
annotations
 (see DictionaryConfiguration.java).
 
 The DictionaryService is decorated with a DictionaryAspect, which you can 
instantiate by adding a
-configuration to the "Spell Checker Aspect Dictionary (api)" pid from web 
console. The
+configuration to the "Spell Checker Aspect Dictionary" pid from web console. 
The
 aspect configuration metatype is also declared using the bnd metatype 
annotations (see
 DictionaryAspectConfiguration.java). 
 
-Before running this sample, go to webconsole, and add some words in the Spell 
Checker Configuration (api) factory PID, and
-in the Spell Checker Aspect Dictionary (api) PID.
+Before running this sample, go to webconsole, and add some words in the "Spell 
Checker Configuration"factory PID, and
+in the "Spell Checker Dictionary Aspect" PID.
 
 Then go to gogo shell, and type dm help. You will normally see the 
dictionary:spellcheck command.
 Type dictionary:spellcheck <some words configured either in the spell checker 
configuration, or in the spell checker aspect configuration, 
-and the dictionary will check for proper word existance in the configuration.
+and the dictionary will check for proper word exactness in the configuration.
 

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/Activator.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/Activator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/factory/Activator.java
 Tue Feb  2 19:46:08 2016
@@ -20,7 +20,9 @@ package org.apache.felix.dm.lambda.sampl
 
 import static java.lang.System.out;
 
+import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.lambda.DependencyManagerActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.log.LogService;
 
 /**
@@ -28,13 +30,13 @@ import org.osgi.service.log.LogService;
  */
 public class Activator extends DependencyManagerActivator {
     @Override
-    public void activate() throws Exception {   
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception 
{   
        out.println("type \"log info\" to see the logs emitted by this test.");
 
         component(comp -> comp
             .factory(ProviderFactory::new, ProviderFactory::create)       
             .provides(Provider.class)
             .start(ProviderImpl::start)                      
-            .withSrv(LogService.class, log -> 
log.required().cb(ProviderImpl::set)));
+            .withSrv(LogService.class, log -> log.cb(ProviderImpl::set)));
     }
 }

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/Activator.java
 Tue Feb  2 19:46:08 2016
@@ -20,7 +20,9 @@ package org.apache.felix.dm.lambda.sampl
 
 import static java.lang.System.out;
 
+import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.lambda.DependencyManagerActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.log.LogService;
 
 /**
@@ -38,7 +40,7 @@ public class Activator extends Dependenc
      * Initialize our components using new DM-lambda activator base.
      */
     @Override
-    public void activate() throws Exception {
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception 
{
        out.println("type \"log info\" to see the logs emitted by this test.");
        
        // System.setProperty("http.proxyHost","your.http.proxy.host");

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/PageLinksImpl.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/PageLinksImpl.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/PageLinksImpl.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/future/PageLinksImpl.java
 Tue Feb  2 19:46:08 2016
@@ -37,7 +37,7 @@ public class PageLinksImpl implements Pa
                .thenApply(this::parseLinks);          
 
            // Add the future dependency so we'll be started once the 
CompletableFuture "futureLinks" has completed.
-           component(c, comp -> comp.withFuture(futureLinks, links -> 
links.cbi(this::setLinks)));
+           component(c, comp -> comp.withFuture(futureLinks, future -> 
future.cbi(this::setLinks)));
        }
        
        // Called when our future has completed.

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda.samples/src/org/apache/felix/dm/lambda/samples/hello/Activator.java
 Tue Feb  2 19:46:08 2016
@@ -20,7 +20,9 @@ package org.apache.felix.dm.lambda.sampl
 
 import static java.lang.System.out;
 
+import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.lambda.DependencyManagerActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.event.EventAdmin;
 import org.osgi.service.log.LogService;
@@ -30,7 +32,7 @@ import org.osgi.service.log.LogService;
  */
 public class Activator extends DependencyManagerActivator {
     @Override
-    public void activate() throws Exception {
+    public void init(BundleContext ctx, DependencyManager dm) throws Exception 
{
        out.println("type \"log info\" to see the logs emitted by this test.");
        
        // Creates a Service Provider (property names are deduced from lambda 
parameter names).

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/ComponentBuilder.java
 Tue Feb  2 19:46:08 2016
@@ -152,10 +152,10 @@ public interface ComponentBuilder<B exte
      *
      * @param iface the public interfaces to register in the OSGI service 
registry.
         * @param properties a list of fluent service properties for the 
provided service. You can specify a list of lambda expression, each one 
implementing the
-        * {@link FluentProperties} interface that allows to define a property 
name using a lambda parameter.
+        * {@link FluentProperty} interface that allows to define a property 
name using a lambda parameter.
      * @return this builder.
         */
-       B provides(Class<?>  iface, FluentProperties ... properties);
+       B provides(Class<?>  iface, FluentProperty ... properties);
        
        /**
      * Sets the public interface under which this component should be 
registered in the OSGi service registry.
@@ -195,10 +195,10 @@ public interface ComponentBuilder<B exte
      *
      * @param ifaces the public interfaces to register in the OSGI service 
registry.
      * @param properties a list of fluent service properties for the provided 
service. You can specify a list of lambda expression, each one implementing the
-     * {@link FluentProperties} interface that allows to define a property 
name using a lambda parameter.
+     * {@link FluentProperty} interface that allows to define a property name 
using a lambda parameter.
      * @return this builder.
      */
-    B provides(Class<?>[] ifaces, FluentProperties ... properties);
+    B provides(Class<?>[] ifaces, FluentProperty ... properties);
     
     /**
      * Sets the public interfaces under which this component should be 
registered in the OSGi service registry.
@@ -238,10 +238,10 @@ public interface ComponentBuilder<B exte
      *
      * @param iface the public interfaces to register in the OSGI service 
registry.
      * @param properties a list of fluent service properties for the provided 
service. You can specify a list of lambda expression, each one implementing the
-     * {@link FluentProperties} interface that allows to define a property 
name using a lambda parameter.
+     * {@link FluentProperty} interface that allows to define a property name 
using a lambda parameter.
      * @return this builder.
      */
-    B provides(String iface, FluentProperties ... properties);
+    B provides(String iface, FluentProperty ... properties);
     
     /**
      * Sets the public interface under which this component should be 
registered in the OSGi service registry.
@@ -281,10 +281,10 @@ public interface ComponentBuilder<B exte
      * 
      * @param ifaces the public interfaces to register in the OSGI service 
registry.
      * @param properties a list of fluent service properties for the provided 
service. You can specify a list of lambda expression, each one implementing the
-     * {@link FluentProperties} interface that allows to define a property 
name using a lambda parameter.
+     * {@link FluentProperty} interface that allows to define a property name 
using a lambda parameter.
      * @return this builder.
      */
-    B provides(String[] ifaces, FluentProperties ... properties);
+    B provides(String[] ifaces, FluentProperty ... properties);
     
     /**
      * Sets the public interfaces under which this component should be 
registered in the OSGi service registry.
@@ -330,7 +330,7 @@ public interface ComponentBuilder<B exte
      * @param properties the fluent properties
      * @return this builder
      */
-    B properties(FluentProperties ... properties);  
+    B properties(FluentProperty ... properties);  
 
     /**
      * Adds a required/autoconfig service dependency.

Modified: 
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=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/DependencyManagerActivator.java
 Tue Feb  2 19:46:08 2016
@@ -72,21 +72,15 @@ public abstract class DependencyManagerA
        /**
         * DependencyManager object used to create/register real DM Components 
that are built by this activator.
         */
-    protected DependencyManager m_manager;
+    private 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();
+        init(context, m_manager);
     }
 
     /**
@@ -94,20 +88,23 @@ public abstract class DependencyManagerA
      */
     @Override
     public void stop(BundleContext context) throws Exception {
-        deactivate();
+        destroy();
     }
 
     /**
      * Sub classes must override this method in order to build some DM 
components.
+     * 
+     * @param ctx the BundleContext associated to the bundle activator.
+     * @param dm the DependencyManager object that can be used to add/remove 
components.
      * @throws Exception if the activation fails
      */
-    protected abstract void activate() throws Exception;
+    protected abstract void init(BundleContext ctx, DependencyManager dm) 
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 {
+    protected void destroy() throws Exception {
     }
     
     /**
@@ -125,7 +122,7 @@ public abstract class DependencyManagerA
      * @return the bundle context
      */
     protected BundleContext getBundleContext() {
-        return m_ctx;
+        return m_manager.getBundleContext();
     }
     
     /**

Added: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperty.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperty.java?rev=1728193&view=auto
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperty.java
 (added)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/FluentProperty.java
 Tue Feb  2 19:46:08 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 FluentProperty 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);
+}

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/AdapterBase.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/AdapterBase.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/AdapterBase.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/AdapterBase.java
 Tue Feb  2 19:46:08 2016
@@ -9,7 +9,7 @@ import java.util.function.Supplier;
 import org.apache.felix.dm.lambda.BundleDependencyBuilder;
 import org.apache.felix.dm.lambda.ComponentBuilder;
 import org.apache.felix.dm.lambda.ConfigurationDependencyBuilder;
-import org.apache.felix.dm.lambda.FluentProperties;
+import org.apache.felix.dm.lambda.FluentProperty;
 import org.apache.felix.dm.lambda.FutureDependencyBuilder;
 import org.apache.felix.dm.lambda.ServiceDependencyBuilder;
 import org.apache.felix.dm.lambda.callbacks.CbComponent;
@@ -71,7 +71,7 @@ public interface AdapterBase<B extends C
         return (B) this;
     }
     
-    default B provides(Class<?>  iface, FluentProperties ... properties) {
+    default B provides(Class<?>  iface, FluentProperty ... properties) {
         andThenBuild(compBuilder -> compBuilder.provides(iface, properties));
         return (B) this;
     }
@@ -91,7 +91,7 @@ public interface AdapterBase<B extends C
         return (B) this;  
     }
     
-    default B provides(Class<?>[] ifaces, FluentProperties ... properties) {
+    default B provides(Class<?>[] ifaces, FluentProperty ... properties) {
         andThenBuild(compBuilder -> compBuilder.provides(ifaces, properties));
         return (B) this;
     }
@@ -111,7 +111,7 @@ public interface AdapterBase<B extends C
         return (B) this;
     }
     
-    default B provides(String  iface, FluentProperties ... properties) {
+    default B provides(String  iface, FluentProperty ... properties) {
         andThenBuild(compBuilder -> compBuilder.provides(iface, properties));
         return (B) this;
     }
@@ -131,7 +131,7 @@ public interface AdapterBase<B extends C
         return (B) this;  
     }
     
-    default B provides(String[] ifaces, FluentProperties ... properties) {
+    default B provides(String[] ifaces, FluentProperty ... properties) {
         andThenBuild(compBuilder -> compBuilder.provides(ifaces, properties));
         return (B) this;
     }
@@ -151,7 +151,7 @@ public interface AdapterBase<B extends C
         return (B) this;
     }
     
-    default B properties(FluentProperties ...properties) {
+    default B properties(FluentProperty ...properties) {
         andThenBuild(compBuilder -> compBuilder.properties(properties));
         return (B) this;
     }

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ComponentBuilderImpl.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ComponentBuilderImpl.java?rev=1728193&r1=1728192&r2=1728193&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ComponentBuilderImpl.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager.lambda/src/org/apache/felix/dm/lambda/impl/ComponentBuilderImpl.java
 Tue Feb  2 19:46:08 2016
@@ -26,7 +26,7 @@ import org.apache.felix.dm.lambda.Bundle
 import org.apache.felix.dm.lambda.ComponentBuilder;
 import org.apache.felix.dm.lambda.ConfigurationDependencyBuilder;
 import org.apache.felix.dm.lambda.DependencyBuilder;
-import org.apache.felix.dm.lambda.FluentProperties;
+import org.apache.felix.dm.lambda.FluentProperty;
 import org.apache.felix.dm.lambda.FutureDependencyBuilder;
 import org.apache.felix.dm.lambda.ServiceDependencyBuilder;
 import org.apache.felix.dm.lambda.callbacks.CbComponent;
@@ -98,7 +98,7 @@ public class ComponentBuilderImpl implem
     }
     
     @Override
-    public ComponentBuilderImpl provides(Class<?>  iface, FluentProperties ... 
properties) {
+    public ComponentBuilderImpl provides(Class<?>  iface, FluentProperty ... 
properties) {
         provides(iface);
         properties(properties);
         return this;
@@ -125,7 +125,7 @@ public class ComponentBuilderImpl implem
     }
     
     @Override
-    public ComponentBuilderImpl provides(Class<?>[] ifaces, FluentProperties 
... properties) {
+    public ComponentBuilderImpl provides(Class<?>[] ifaces, FluentProperty ... 
properties) {
         provides(ifaces);
         properties(properties);
         return this;
@@ -152,7 +152,7 @@ public class ComponentBuilderImpl implem
     }
     
     @Override
-    public ComponentBuilderImpl provides(String iface, FluentProperties ... 
properties) {
+    public ComponentBuilderImpl provides(String iface, FluentProperty ... 
properties) {
         provides(iface);
         properties(properties);
         return this;
@@ -179,7 +179,7 @@ public class ComponentBuilderImpl implem
     }
     
     @Override
-    public ComponentBuilderImpl provides(String[] ifaces, FluentProperties ... 
properties) {
+    public ComponentBuilderImpl provides(String[] ifaces, FluentProperty ... 
properties) {
         provides(ifaces);
         properties(properties);
         return this;
@@ -218,7 +218,7 @@ public class ComponentBuilderImpl implem
     }
     
     @Override
-    public ComponentBuilderImpl properties(FluentProperties ... properties) {
+    public ComponentBuilderImpl properties(FluentProperty ... properties) {
        Dictionary<Object, Object> props = new Hashtable<>();
        Stream.of(properties).forEach(property -> {
                String name = Helpers.getLambdaParameterName(property, 0);


Reply via email to