FELIX-50 Added support for configuration dependencies. Read the JavaDoc of ConfigurationDependency for more info.
Updated all headers to contain the correct license information and @author.
Fixed an issue with methods not becoming accessible (which was caused by some strange, undocumented behaviour).
Fixed an issue that prevented callback methods in superclasses from being invocable.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@544776 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/pom.xml b/dependencymanager/pom.xml
index 035b6fc..b3fadca 100644
--- a/dependencymanager/pom.xml
+++ b/dependencymanager/pom.xml
@@ -15,6 +15,12 @@
       <version>${pom.version}</version>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <version>${pom.version}</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
new file mode 100644
index 0000000..2fb2c3a
--- /dev/null
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.dependencymanager;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+
+/**
+ * Configuration dependency that can track the availability of a (valid) configuration.
+ * To use it, specify a PID for the configuration. The dependency is always required,
+ * because if it is not, it does not make sense to use the dependency manager. In that
+ * scenario, simply register your service as a <code>ManagedService(Factory></code> and
+ * handle everything yourself. Also, only managed services are supported, not factories.
+ * There are a couple of things you need to be aware of when implementing the
+ * <code>updated(Dictionary)</code> method:
+ * <li>
+ * <ul>Make sure it throws a <code>ConfigurationException</code> when you get a
+ * configuration that is invalid. In this case, the dependency will not change:
+ * if it was not available, it will still not be. If it was available, it will
+ * remain available and implicitly assume you keep working with your old
+ * configuration.</ul>
+ * <ul>This method will be called before all required dependencies are available.
+ * Make sure you do not depend on these to parse your settings.</ul>
+ * </li>
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class ConfigurationDependency implements Dependency, ManagedService {
+	private BundleContext m_context;
+	private String m_pid;
+	private ServiceRegistration m_registration;
+	private volatile Service m_service;
+	private Dictionary m_settings;
+	
+	public ConfigurationDependency(BundleContext context) {
+		m_context = context;
+	}
+	
+	public boolean isAvailable() {
+		return m_settings != null;
+	}
+
+	public boolean isRequired() {
+		return true;
+	}
+	
+	public void start(Service service) {
+		m_service = service;
+		Properties props = new Properties();
+		props.put(Constants.SERVICE_PID, m_pid);
+		m_registration = m_context.registerService(ManagedService.class.getName(), this, props);
+	}
+
+	public void stop(Service service) {
+		m_registration.unregister();
+		m_service = null;
+	}
+
+	public void updated(Dictionary settings) throws ConfigurationException {
+		// if non-null settings come in, we have to instantiate the service and
+		// apply these settings
+		((ServiceImpl) m_service).initService();
+		Object service = m_service.getService();
+		if (service != null) {
+			if (service instanceof ManagedService) {
+				ManagedService ms = (ManagedService) service;
+				ms.updated(settings);
+				
+				// if exception is thrown here, what does that mean for the
+				// state of this dependency? how smart do we want to be??
+				// it's okay like this, if the new settings contain errors, we
+				// remain in the state we were, assuming that any error causes
+				// the "old" configuration to stay in effect
+			}
+		}
+		else {
+			throw new IllegalStateException("Could not instantiate implementation");
+		}
+		// if these settings did not cause a configuration exception, we determine
+		// if they have caused the dependency state to change
+		Dictionary oldSettings = m_settings;
+		m_settings = settings;
+		if ((oldSettings == null) && (settings != null)) {
+			m_service.dependencyAvailable(this);
+		}
+		if ((oldSettings == null) && (settings == null)) {
+			m_service.dependencyUnavailable(this);
+		}
+		if ((oldSettings != null) && (settings != null)) {
+			m_service.dependencyChanged(this);
+		}
+	}
+
+	public ConfigurationDependency setPid(String pid) {
+		ensureNotActive();
+		m_pid = pid;
+		return this;
+	}
+	
+    private void ensureNotActive() {
+        if (m_service != null) {
+            throw new IllegalStateException("Cannot modify state while active.");
+        }
+    }
+}
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DefaultNullObject.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DefaultNullObject.java
index 82a86d8..fbd5d7a 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DefaultNullObject.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DefaultNullObject.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -24,7 +26,7 @@
  * Default null object implementation. Uses a dynamic proxy. Null objects are used
  * as placeholders for services that are not available.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class DefaultNullObject implements InvocationHandler {
     private static final Boolean DEFAULT_BOOLEAN = Boolean.FALSE;
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Dependency.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Dependency.java
index 2e5d495..64d241a 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Dependency.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Dependency.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -28,7 +30,7 @@
  * methods. State changes of the dependency itself may only be made as long as
  * the dependency is not 'active', meaning it is associated with a running service.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface Dependency {
     /**
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyActivatorBase.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyActivatorBase.java
index 6d3ec3c..f11ea04 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyActivatorBase.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyActivatorBase.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -28,7 +30,7 @@
  * the bundle context and the dependency manager. The dependency manager can be used
  * to define all the dependencies.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public abstract class DependencyActivatorBase implements BundleActivator {
     private BundleContext m_context;
@@ -102,6 +104,15 @@
     public ServiceDependency createServiceDependency() {
         return new ServiceDependency(m_context);
     }
+    
+    /**
+     * Creates a new configuration dependency.
+     * 
+     * @return the configuration dependency
+     */
+    public ConfigurationDependency createConfigurationDependency() {
+    	return new ConfigurationDependency(m_context);
+    }
 
     /**
      * Cleans up all services and their dependencies.
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyManager.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyManager.java
index cfbc398..40e9e53 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyManager.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/DependencyManager.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -25,7 +27,7 @@
 /**
  * The dependency manager. Manages all services and their dependencies.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class DependencyManager {
     private BundleContext m_context;
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Service.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Service.java
index cd6cf9c..a72174a 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Service.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/Service.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -24,7 +26,7 @@
 /**
  * Service interface.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface Service {
     /**
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java
index 9da2217..11e5c9e 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java
@@ -1,22 +1,23 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
-import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
@@ -29,7 +30,7 @@
 /**
  * Service dependency that can track an OSGi service.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ServiceDependency implements Dependency, ServiceTrackerCustomizer {
     private boolean m_isRequired;
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java
index 9fcd567..3b1be60 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java
@@ -1,23 +1,26 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.ArrayList;
 import java.util.Dictionary;
@@ -31,7 +34,7 @@
 /**
  * Service implementation.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ServiceImpl implements Service {
     private static final ServiceRegistration NULL_REGISTRATION;
@@ -237,12 +240,22 @@
     private void invoke(String name) {
         if (name != null) {
             // invoke method if it exists
-            AccessibleObject.setAccessible(m_serviceInstance.getClass().getDeclaredMethods(), true);
             try {
-                m_serviceInstance.getClass().getDeclaredMethod(name, null).invoke(m_serviceInstance, null);
-            }
-            catch (NoSuchMethodException e) {
-                // ignore this, we don't care if the method does not exist
+                Class clazz = m_serviceInstance.getClass();
+                while (clazz != null) {
+                	try {
+                	Method method = clazz.getDeclaredMethod(name, null);
+	                	if (method != null) {
+	                		AccessibleObject.setAccessible(new AccessibleObject[] { method }, true);
+	                		method.invoke(m_serviceInstance, null);
+	                		return;
+	                	}
+                	}
+                	catch (NoSuchMethodException e) {
+                		// ignore this, we keep searching if the method does not exist
+                	}
+                	clazz = clazz.getSuperclass();
+                }
             }
             catch (Exception e) {
                 // TODO handle this exception
@@ -340,26 +353,27 @@
         }
     }
 
-    private void initService() {
-        if (m_implementation instanceof Class) {
-            // instantiate
-            try {
-                m_serviceInstance = ((Class) m_implementation).newInstance();
-            } catch (InstantiationException e) {
-                // TODO handle this exception
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                // TODO handle this exception
-                e.printStackTrace();
-            }
-        }
-        else {
-            m_serviceInstance = m_implementation;
-        }
-        // configure the bundle context
-        configureImplementation(BundleContext.class, m_context);
-        configureImplementation(ServiceRegistration.class, NULL_REGISTRATION);
-        
+    void initService() {
+    	if (m_serviceInstance == null) {
+	        if (m_implementation instanceof Class) {
+	            // instantiate
+	            try {
+	                m_serviceInstance = ((Class) m_implementation).newInstance();
+	            } catch (InstantiationException e) {
+	                // TODO handle this exception
+	                e.printStackTrace();
+	            } catch (IllegalAccessException e) {
+	                // TODO handle this exception
+	                e.printStackTrace();
+	            }
+	        }
+	        else {
+	            m_serviceInstance = m_implementation;
+	        }
+	        // configure the bundle context
+	        configureImplementation(BundleContext.class, m_context);
+	        configureImplementation(ServiceRegistration.class, NULL_REGISTRATION);
+    	}        
     }
     
     private void configureService() {
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceRegistrationImpl.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceRegistrationImpl.java
index 38eadcc..e86a0fb 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceRegistrationImpl.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceRegistrationImpl.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -25,7 +27,7 @@
  * A wrapper around a service registration that blocks until the
  * service registration is available.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ServiceRegistrationImpl implements ServiceRegistration {
     public static final ServiceRegistrationImpl ILLEGAL_STATE = new ServiceRegistrationImpl();
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceStateListener.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceStateListener.java
index 38e8bae..1e2d18b 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceStateListener.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceStateListener.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -22,7 +24,7 @@
  * when the service is starting, started, stopping and stopped. Each callback
  * includes a reference to the service in question.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface ServiceStateListener {
     /**
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTracker.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTracker.java
index 53c2e76..0202e49 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTracker.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTracker.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -34,7 +36,7 @@
  * integrate only the parts I want as soon as this code is finished. Perhaps
  * it would be better to borrow the Knopflerfish implementation here.
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ServiceTracker implements ServiceTrackerCustomizer
 {
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTrackerCustomizer.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTrackerCustomizer.java
index 95d47c7..93dd6f6 100644
--- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTrackerCustomizer.java
+++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceTrackerCustomizer.java
@@ -1,18 +1,20 @@
 /*
- *   Copyright 2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.felix.dependencymanager;
 
@@ -23,7 +25,7 @@
  * extra callback "addedservice" that is invoked after the service has been added
  * to the tracker (and therefore is accessible through the tracker API)
  * 
- * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface ServiceTrackerCustomizer {
     public Object addingService(ServiceReference ref);