FELIX-5177:

- added a configType attribute in FactoryConfigurationAdapterService annotation.
- when using a config type with ConfigurationDependency, then assume that pid is set to the fqdn of the provided config type, in case
no pid has already been set using setPid method.
- code cleanup.
- adapted samples to use configuration type.
- added javadocs.


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1730934 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java b/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
index 1122d44..5725161 100644
--- a/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
+++ b/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
@@ -21,6 +21,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.util.Arrays;
 import java.util.Dictionary;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
@@ -126,8 +127,10 @@
      * Sets a type-safe callback method invoked on the instantiated component.
      */
     public ConfigurationDependency setCallback(String callback, Class<?> configType) {
+        Objects.nonNull(configType);
         setCallback(callback);
         m_configType = configType;
+        m_pid = (m_pid == null) ? configType.getName() : m_pid;
         return this;
     }
 
@@ -136,8 +139,10 @@
      * The component is not yet instantiated at the time the callback is invoked.
      */
     public ConfigurationDependency setCallback(Object instance, String callback, Class<?> configType) {
+        Objects.nonNull(configType);
         setCallback(instance, callback);
         m_configType = configType;
+        m_pid = (m_pid == null) ? configType.getName() : m_pid;
         return this;
     }