You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pd...@apache.org on 2018/10/09 13:33:43 UTC

svn commit: r1843265 - /felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext

Author: pderop
Date: Tue Oct  9 13:33:43 2018
New Revision: 1843265

URL: http://svn.apache.org/viewvc?rev=1843265&view=rev
Log:
dm r12 updates

Modified:
    felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext?rev=1843265&r1=1843264&r2=1843265&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext (original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext Tue Oct  9 13:33:43 2018
@@ -1,8 +1,18 @@
 Title: Dependency Manager - Factory Configuration Adapter Service
 
-A factory configuration adapter service creates an adapter for each matching configuration in Configuration Admin. For each new 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. It will also inherit all dependencies.
+A factory configuration adapter service creates an adapter for each matching configuration in 
+Configuration Admin. For each new 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. It will also inherit all dependencies.
+
+To define an adapter component, you need to create an [FactoryComponent](http://felix.staging.apache.org/apidocs/dependencymanager/r12/org/apache/felix/dm/FactoryComponent.html) component
+using the DependencyActivatorBase.createFactoryComponent() or the DependencyManager.createFactoryComponent() method.
+The FactoryComponent interface extends the Component interface in order to add extra setters methods needed to define a factory configuration adapter service component.
 
-## Example using DM API
+
+Example usage:
 
 Here is a sample showing a "MyComponent" component, which can be instantiated multiple times using a factory configuration:
 
@@ -32,28 +42,3 @@ Here is a sample showing a "MyComponent"
         }
     }
  
-## Example using DM Lambda API
-
-    :::java
-    public class Activator extends DependencyManagerActivator {
-        public void init(BundleContext ctx, DependencyManager dm) throws Exception { 
-            factoryPidAdapter(adapter -> adapter
-                .factoryPid("my.factory.pid")
-                .provides(MySevice.class)
-                .impl(DictionaryImpl.class)
-                .update(MyConfig.class, MyComponent::updated)                
-       }
-    }
-
-## Example using DM Annotations
-
-    :::java
-    @Component(factoryPid = "my.factory.pid")
-    public class MyComponent implements MyService {
-        void updated(MyConfig cnf) {
-            int port = cnf.getPort();
-            String addr = cnf.getAddress();
-            ...
-        }
-    }
-