You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by gn...@apache.org on 2016/05/20 13:43:43 UTC

svn commit: r1744735 - in /felix/trunk/scr/src: main/java/org/apache/felix/scr/impl/ main/java/org/apache/felix/scr/impl/config/ main/java/org/apache/felix/scr/impl/manager/ main/java/org/apache/felix/scr/impl/metadata/ main/java/org/apache/felix/scr/i...

Author: gnodet
Date: Fri May 20 13:43:39 2016
New Revision: 1744735

URL: http://svn.apache.org/viewvc?rev=1744735&view=rev
Log:
[FELIX-5243] Introduce a ComponentActivator interface and move TargetedPID to config package

Added:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentActivator.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/TargetedPID.java
      - copied, changed from r1744519, felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/TargetedPID.java
Removed:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/TargetedPID.java
Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentContainer.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentHolder.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigAdminTracker.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurableComponentHolder.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/RegionConfigurationSupport.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java
    felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/config/ConfiguredComponentHolderTest.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java Fri May 20 13:43:39 2016
@@ -35,16 +35,15 @@ import java.util.concurrent.CountDownLat
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.apache.felix.scr.impl.config.ComponentActivator;
 import org.apache.felix.scr.impl.config.ComponentHolder;
 import org.apache.felix.scr.impl.config.ConfigAdminTracker;
 import org.apache.felix.scr.impl.config.RegionConfigurationSupport;
 import org.apache.felix.scr.impl.config.ScrConfiguration;
-import org.apache.felix.scr.impl.helper.Logger;
 import org.apache.felix.scr.impl.manager.AbstractComponentManager;
 import org.apache.felix.scr.impl.manager.DependencyManager;
 import org.apache.felix.scr.impl.manager.ExtendedServiceEvent;
 import org.apache.felix.scr.impl.manager.ExtendedServiceListener;
-import org.apache.felix.scr.impl.manager.ExtendedServiceListenerContext;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;
 import org.apache.felix.scr.impl.metadata.XmlHandler;
 import org.apache.felix.scr.impl.parser.KXml2SAXParser;
@@ -55,6 +54,7 @@ import org.osgi.framework.InvalidSyntaxE
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.component.ComponentException;
 import org.osgi.service.log.LogService;
 import org.osgi.util.tracker.ServiceTracker;
@@ -64,7 +64,7 @@ import org.osgi.util.tracker.ServiceTrac
  * a single bundle. It will read information from the metadata.xml file
  * descriptors and create the corresponding managers.
  */
-public class BundleComponentActivator implements Logger, ExtendedServiceListenerContext<ExtendedServiceEvent>
+public class BundleComponentActivator implements ComponentActivator
 {
 	
     // global component registration
@@ -245,7 +245,7 @@ public class BundleComponentActivator im
      *
      * @throws ComponentException if any error occurrs initializing this class
      */
-    BundleComponentActivator(ComponentRegistry componentRegistry, ComponentActorThread componentActor, BundleContext context, ScrConfiguration configuration) throws ComponentException
+    public BundleComponentActivator(ComponentRegistry componentRegistry, ComponentActorThread componentActor, BundleContext context, ScrConfiguration configuration) throws ComponentException
     {
         // keep the parameters for later
         m_componentRegistry = componentRegistry;
@@ -277,7 +277,7 @@ public class BundleComponentActivator im
         {
         	if (!holder.getComponentMetadata().isConfigurationIgnored())
         	{
-        		tracker = new ConfigAdminTracker(this, componentRegistry);
+        		tracker = new ConfigAdminTracker(this);
         		break;
         	}
         }
@@ -293,7 +293,7 @@ public class BundleComponentActivator im
      *
      * @throws IllegalStateException If the bundle has already been uninstalled.
      */
-    private void initialize(String descriptorLocations)
+    protected void initialize(String descriptorLocations)
     {
         log(LogService.LOG_DEBUG,
             "BundleComponentActivator : Bundle [{0}] descriptor locations {1}",
@@ -848,14 +848,18 @@ public class BundleComponentActivator im
             serviceReference, trackingCount);
     }
 
-	public void setRegionConfigurationSupport(RegionConfigurationSupport rcs) {
-		for (ComponentHolder<?> holder: m_holders)
-		{
-			rcs.configureComponentHolder(holder);
-		}		
-	}
+    public RegionConfigurationSupport setRegionConfigurationSupport(ServiceReference<ConfigurationAdmin> reference) {
+        RegionConfigurationSupport trialRcs = new RegionConfigurationSupport(reference, m_componentRegistry);
+        RegionConfigurationSupport rcs = m_componentRegistry.registerRegionConfigurationSupport(trialRcs);
+        for (ComponentHolder<?> holder: m_holders)
+        {
+            rcs.configureComponentHolder(holder);
+        }
+        return rcs;
+    }
 
-	public void unsetRegionConfigurationSupport(RegionConfigurationSupport rcs) {
-		// TODO anything needed?		
+    public void unsetRegionConfigurationSupport(RegionConfigurationSupport rcs) {
+        m_componentRegistry.unregisterRegionConfigurationSupport(rcs);
+		// TODO anything needed?
 	}
 }

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java Fri May 20 13:43:39 2016
@@ -29,9 +29,11 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
+import org.apache.felix.scr.impl.config.ComponentActivator;
 import org.apache.felix.scr.impl.config.ComponentHolder;
 import org.apache.felix.scr.impl.config.ConfigurableComponentHolder;
 import org.apache.felix.scr.impl.config.RegionConfigurationSupport;
+import org.apache.felix.scr.impl.config.TargetedPID;
 import org.apache.felix.scr.impl.manager.AbstractComponentManager;
 import org.apache.felix.scr.impl.manager.DependencyManager;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;
@@ -108,7 +110,7 @@ public class ComponentRegistry
 
     private final Map<ServiceReference<?>, List<Entry<?, ?>>> m_missingDependencies = new HashMap<ServiceReference<?>, List<Entry<?, ?>>>( );
 
-    protected ComponentRegistry( )
+    public ComponentRegistry( )
     {
         m_componentHoldersByName = new HashMap<ComponentRegistryKey, ComponentHolder<?>>();
         m_componentHoldersByPid = new HashMap<String, Set<ComponentHolder<?>>>();
@@ -334,7 +336,7 @@ public class ComponentRegistry
         List<ComponentHolder<?>> holders = new ArrayList<ComponentHolder<?>>();
         for ( ComponentHolder<?> holder: all)
         {
-        	BundleComponentActivator activator = holder.getActivator();
+        	ComponentActivator activator = holder.getActivator();
         	if (activator != null)
         	{
         		Bundle holderBundle = activator.getBundleContext().getBundle();
@@ -406,7 +408,7 @@ public class ComponentRegistry
      * Factory method to issue {@link ComponentHolder} instances to manage
      * components described by the given component <code>metadata</code>.
      */
-    public <S> ComponentHolder<S> createComponentHolder( BundleComponentActivator activator, ComponentMetadata metadata )
+    public <S> ComponentHolder<S> createComponentHolder( ComponentActivator activator, ComponentMetadata metadata )
     {
         return new ConfigurableComponentHolder<S>(activator, metadata);
     }

Added: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentActivator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentActivator.java?rev=1744735&view=auto
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentActivator.java (added)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentActivator.java Fri May 20 13:43:39 2016
@@ -0,0 +1,57 @@
+/*
+ * 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.scr.impl.config;
+
+import org.apache.felix.scr.impl.helper.Logger;
+import org.apache.felix.scr.impl.manager.AbstractComponentManager;
+import org.apache.felix.scr.impl.manager.DependencyManager;
+import org.apache.felix.scr.impl.manager.ExtendedServiceEvent;
+import org.apache.felix.scr.impl.manager.ExtendedServiceListenerContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+public interface ComponentActivator extends Logger, ExtendedServiceListenerContext<ExtendedServiceEvent> {
+
+    BundleContext getBundleContext();
+
+    boolean isActive();
+
+    ScrConfiguration getConfiguration();
+
+    void schedule(Runnable runnable);
+
+    long registerComponentId(AbstractComponentManager<?> sAbstractComponentManager);
+
+    void unregisterComponentId(AbstractComponentManager<?> sAbstractComponentManager);
+
+    <T> void registerMissingDependency(DependencyManager<?, T> dependencyManager,
+                                              ServiceReference<T> serviceReference, int trackingCount);
+
+    void missingServicePresent(ServiceReference<?> serviceReference);
+
+    void enableComponent(String name);
+
+    void disableComponent(String name);
+
+    RegionConfigurationSupport setRegionConfigurationSupport(ServiceReference<ConfigurationAdmin> reference);
+
+    void unsetRegionConfigurationSupport(RegionConfigurationSupport rcs);
+
+}

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentContainer.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentContainer.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentContainer.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentContainer.java Fri May 20 13:43:39 2016
@@ -18,7 +18,6 @@
  */
 package org.apache.felix.scr.impl.config;
 
-import org.apache.felix.scr.impl.BundleComponentActivator;
 import org.apache.felix.scr.impl.manager.SingleComponentManager;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;
 
@@ -26,10 +25,10 @@ public interface ComponentContainer<S>
 {
 
     /**
-     * Returns the {@link BundleComponentActivator} owning this component
+     * Returns the {@link ComponentActivator} owning this component
      * holder.  (overlaps ComponentHolder)
      */
-    BundleComponentActivator getActivator();
+    ComponentActivator getActivator();
 
     /**
      * Returns the {@link ComponentMetadata} describing and declaring this

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentHolder.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentHolder.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentHolder.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ComponentHolder.java Fri May 20 13:43:39 2016
@@ -22,8 +22,6 @@ package org.apache.felix.scr.impl.config
 import java.util.Dictionary;
 import java.util.List;
 
-import org.apache.felix.scr.impl.BundleComponentActivator;
-import org.apache.felix.scr.impl.TargetedPID;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;
 import org.osgi.util.promise.Promise;
 
@@ -42,10 +40,10 @@ public interface ComponentHolder<S>
 {
 
     /**
-     * Returns the {@link BundleComponentActivator} owning this component
+     * Returns the {@link ComponentActivator} owning this component
      * holder. (overlaps ComponentContaienr)
      */
-    BundleComponentActivator getActivator();
+    ComponentActivator getActivator();
 
     /**
      * Returns the {@link ComponentMetadata} describing and declaring this

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigAdminTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigAdminTracker.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigAdminTracker.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigAdminTracker.java Fri May 20 13:43:39 2016
@@ -18,10 +18,7 @@
  */
 package org.apache.felix.scr.impl.config;
 
-import org.apache.felix.scr.impl.BundleComponentActivator;
-import org.apache.felix.scr.impl.ComponentRegistry;
 import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.util.tracker.ServiceTracker;
@@ -33,7 +30,7 @@ public class ConfigAdminTracker
 	
 	private final ServiceTracker<ConfigurationAdmin, RegionConfigurationSupport> configAdminTracker;
 
-	static ConfigAdminTracker getRegionConfigurationSupport(final BundleComponentActivator bundleComponentActivator, final ComponentRegistry registry, final Bundle dsBundle)
+	static ConfigAdminTracker getRegionConfigurationSupport(final ComponentActivator componentActivator, final Bundle dsBundle)
 	{
 		Class<?> ourCA;
 		Class<?> theirCA;
@@ -47,7 +44,7 @@ public class ConfigAdminTracker
 		}
 		try
 		{
-			Bundle bundle = bundleComponentActivator.getBundleContext().getBundle();
+			Bundle bundle = componentActivator.getBundleContext().getBundle();
 			if ( bundle == null )
 			{
 				return null;
@@ -62,26 +59,23 @@ public class ConfigAdminTracker
 		{
 			return null;
 		}
-		ConfigAdminTracker tracker = new ConfigAdminTracker(bundleComponentActivator, registry);
+		ConfigAdminTracker tracker = new ConfigAdminTracker(componentActivator);
 		return tracker;
 	}
 
-	public ConfigAdminTracker(final BundleComponentActivator bundleComponentActivator, final ComponentRegistry registry)
+	public ConfigAdminTracker(final ComponentActivator componentActivator)
 	{
 		
 		//TODO this assumes that there is 0 or 1 ca service visible to the bundle being extended.
 		//Is this sure to be true?
-		configAdminTracker = new ServiceTracker<ConfigurationAdmin, RegionConfigurationSupport>(bundleComponentActivator.getBundleContext(), 
+		configAdminTracker = new ServiceTracker<ConfigurationAdmin, RegionConfigurationSupport>(componentActivator.getBundleContext(),
 				CONFIGURATION_ADMIN, 
 				new ServiceTrackerCustomizer<ConfigurationAdmin, RegionConfigurationSupport>() 
 				{
 
 			public RegionConfigurationSupport addingService(
 					ServiceReference<ConfigurationAdmin> reference) {
-				RegionConfigurationSupport trialRcs = new RegionConfigurationSupport(reference, registry);
-				RegionConfigurationSupport rcs = registry.registerRegionConfigurationSupport(trialRcs);
-				bundleComponentActivator.setRegionConfigurationSupport(rcs);
-				return rcs;
+				return componentActivator.setRegionConfigurationSupport(reference);
 			}
 
 			public void modifiedService(
@@ -92,8 +86,7 @@ public class ConfigAdminTracker
 			public void removedService(
 					ServiceReference<ConfigurationAdmin> reference,
 					RegionConfigurationSupport rcs) {
-				registry.unregisterRegionConfigurationSupport(rcs);
-				bundleComponentActivator.unsetRegionConfigurationSupport(rcs);
+				componentActivator.unsetRegionConfigurationSupport(rcs);
 			}
 				});
 

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurableComponentHolder.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurableComponentHolder.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurableComponentHolder.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurableComponentHolder.java Fri May 20 13:43:39 2016
@@ -30,8 +30,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.felix.scr.impl.Activator;
-import org.apache.felix.scr.impl.BundleComponentActivator;
-import org.apache.felix.scr.impl.TargetedPID;
 import org.apache.felix.scr.impl.helper.ComponentMethods;
 import org.apache.felix.scr.impl.helper.SimpleLogger;
 import org.apache.felix.scr.impl.manager.AbstractComponentManager;
@@ -71,7 +69,7 @@ public class ConfigurableComponentHolder
     /**
      * The activator owning the per-bundle components
      */
-    private final BundleComponentActivator m_activator;
+    private final ComponentActivator m_activator;
 
     /**
      * The {@link ComponentMetadata} describing the held component(s)
@@ -148,7 +146,7 @@ public class ConfigurableComponentHolder
 
     private final ComponentMethods m_componentMethods;
 
-    public ConfigurableComponentHolder( final BundleComponentActivator activator, final ComponentMetadata metadata )
+    public ConfigurableComponentHolder( final ComponentActivator activator, final ComponentMetadata metadata )
     {
         this.m_activator = activator;
         this.m_componentMetadata = metadata;
@@ -205,7 +203,7 @@ public class ConfigurableComponentHolder
     }
 
 
-    public final BundleComponentActivator getActivator()
+    public final ComponentActivator getActivator()
     {
         return m_activator;
     }
@@ -826,7 +824,7 @@ public class ConfigurableComponentHolder
 
     public void log( int level, String message, Throwable ex )
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             activator.log( level, message, getComponentMetadata(), null, ex );
@@ -835,7 +833,7 @@ public class ConfigurableComponentHolder
 
     public void log( int level, String message, Object[] arguments, Throwable ex )
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             activator.log( level, message, arguments, getComponentMetadata(), null, ex );

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/RegionConfigurationSupport.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/RegionConfigurationSupport.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/RegionConfigurationSupport.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/RegionConfigurationSupport.java Fri May 20 13:43:39 2016
@@ -29,9 +29,7 @@ import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.felix.scr.impl.Activator;
-import org.apache.felix.scr.impl.BundleComponentActivator;
 import org.apache.felix.scr.impl.ComponentRegistry;
-import org.apache.felix.scr.impl.TargetedPID;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -44,7 +42,6 @@ import org.osgi.service.cm.Configuration
 import org.osgi.service.cm.ConfigurationListener;
 import org.osgi.service.cm.ConfigurationPermission;
 import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
 
 public class RegionConfigurationSupport implements ConfigurationListener
 {
@@ -278,7 +275,7 @@ public class RegionConfigurationSupport
 
                 case ConfigurationEvent.CM_UPDATED:
                 {
-                    final BundleComponentActivator activator = componentHolder.getActivator();
+                    final ComponentActivator activator = componentHolder.getActivator();
                     if (activator == null)
                     {
                         break;
@@ -317,7 +314,7 @@ public class RegionConfigurationSupport
                 case ConfigurationEvent.CM_LOCATION_CHANGED:
                 {
                     //TODO is this logic correct for factory pids????
-                    final BundleComponentActivator activator = componentHolder.getActivator();
+                    final ComponentActivator activator = componentHolder.getActivator();
                     if (activator == null)
                     {
                         break;

Copied: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/TargetedPID.java (from r1744519, felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/TargetedPID.java)
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/TargetedPID.java?p2=felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/TargetedPID.java&p1=felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/TargetedPID.java&r1=1744519&r2=1744735&rev=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/TargetedPID.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/TargetedPID.java Fri May 20 13:43:39 2016
@@ -16,9 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.scr.impl;
+package org.apache.felix.scr.impl.config;
 
-import org.apache.felix.scr.impl.config.ComponentHolder;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java Fri May 20 13:43:39 2016
@@ -41,7 +41,7 @@ import java.util.concurrent.locks.Reentr
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.felix.scr.impl.Activator;
-import org.apache.felix.scr.impl.BundleComponentActivator;
+import org.apache.felix.scr.impl.config.ComponentActivator;
 import org.apache.felix.scr.impl.config.ComponentContainer;
 import org.apache.felix.scr.impl.config.ComponentManager;
 import org.apache.felix.scr.impl.config.ReferenceManager;
@@ -180,7 +180,7 @@ public abstract class AbstractComponentM
 
     final long getLockTimeout()
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             return activator.getConfiguration().lockTimeout();
@@ -362,7 +362,7 @@ public abstract class AbstractComponentM
 
     void registerComponentId()
     {
-        final BundleComponentActivator activator = getActivator();
+        final ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             this.m_componentId = activator.registerComponentId( this );
@@ -374,7 +374,7 @@ public abstract class AbstractComponentM
     {
         if ( this.m_componentId >= 0 )
         {
-            final BundleComponentActivator activator = getActivator();
+            final ComponentActivator activator = getActivator();
             if ( activator != null )
             {
                 activator.unregisterComponentId( this );
@@ -552,7 +552,7 @@ public abstract class AbstractComponentM
 
     <T> void registerMissingDependency( DependencyManager<S, T> dm, ServiceReference<T> ref, int trackingCount)
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             activator.registerMissingDependency( dm, ref, trackingCount );
@@ -595,7 +595,7 @@ public abstract class AbstractComponentM
 
     BundleContext getBundleContext()
     {
-        final BundleComponentActivator activator = getActivator();
+        final ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             return activator.getBundleContext();
@@ -1001,7 +1001,7 @@ public abstract class AbstractComponentM
     abstract <T> void invokeUnbindMethod( DependencyManager<S, T> dependencyManager, RefPair<S, T> oldRefPair, int trackingCount );
 
     //**********************************************************************************************************
-    public BundleComponentActivator getActivator()
+    public ComponentActivator getActivator()
     {
         return m_container.getActivator();
     }
@@ -1009,7 +1009,7 @@ public abstract class AbstractComponentM
 
     boolean isActivatorActive()
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         return activator != null && activator.isActive();
     }
 
@@ -1034,7 +1034,7 @@ public abstract class AbstractComponentM
 
     public void log( int level, String message, Throwable ex )
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             activator.log( level, message, getComponentMetadata(), m_componentId, ex );
@@ -1043,7 +1043,7 @@ public abstract class AbstractComponentM
 
     public void log( int level, String message, Object[] arguments, Throwable ex )
     {
-        BundleComponentActivator activator = getActivator();
+        ComponentActivator activator = getActivator();
         if ( activator != null )
         {
             activator.log( level, message, arguments, getComponentMetadata(), m_componentId, ex );

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java Fri May 20 13:43:39 2016
@@ -24,7 +24,7 @@ import java.util.concurrent.CountDownLat
 import java.util.concurrent.TimeUnit;
 
 import org.apache.felix.scr.component.ExtComponentContext;
-import org.apache.felix.scr.impl.BundleComponentActivator;
+import org.apache.felix.scr.impl.config.ComponentActivator;
 import org.apache.felix.scr.impl.helper.ComponentServiceObjectsHelper;
 import org.apache.felix.scr.impl.helper.ReadOnlyDictionary;
 import org.osgi.framework.Bundle;
@@ -189,7 +189,7 @@ public class ComponentContextImpl<S> imp
 
     public void enableComponent( String name )
     {
-        BundleComponentActivator activator = m_componentManager.getActivator();
+        ComponentActivator activator = m_componentManager.getActivator();
         if ( activator != null )
         {
             activator.enableComponent( name );
@@ -199,7 +199,7 @@ public class ComponentContextImpl<S> imp
 
     public void disableComponent( String name )
     {
-        BundleComponentActivator activator = m_componentManager.getActivator();
+        ComponentActivator activator = m_componentManager.getActivator();
         if ( activator != null )
         {
             activator.disableComponent( name );

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java Fri May 20 13:43:39 2016
@@ -27,8 +27,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.felix.scr.component.ExtFactoryComponentInstance;
-import org.apache.felix.scr.impl.BundleComponentActivator;
-import org.apache.felix.scr.impl.TargetedPID;
+import org.apache.felix.scr.impl.config.TargetedPID;
 import org.apache.felix.scr.impl.config.ComponentContainer;
 import org.apache.felix.scr.impl.helper.ComponentMethods;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java Fri May 20 13:43:39 2016
@@ -31,7 +31,7 @@ import java.util.concurrent.CountDownLat
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
-import org.apache.felix.scr.impl.BundleComponentActivator;
+import org.apache.felix.scr.impl.config.ComponentActivator;
 import org.apache.felix.scr.impl.config.ReferenceManager;
 import org.apache.felix.scr.impl.helper.BindParameters;
 import org.apache.felix.scr.impl.helper.Coercions;
@@ -1217,7 +1217,7 @@ public class DependencyManager<S, T> imp
         if ( hasGetPermission() )
         {
             // component activator may be null if disposed concurrently
-            BundleComponentActivator bca = m_componentManager.getActivator();
+            ComponentActivator bca = m_componentManager.getActivator();
             if ( bca == null )
             {
                 return null;

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java Fri May 20 13:43:39 2016
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.felix.scr.impl.BundleComponentActivator;
+import org.apache.felix.scr.impl.config.ComponentActivator;
 import org.apache.felix.scr.impl.config.ComponentContainer;
 import org.apache.felix.scr.impl.config.ReferenceManager;
 import org.apache.felix.scr.impl.helper.ActivatorParameter;
@@ -135,7 +135,7 @@ public class SingleComponentManager<S> e
             log( LogService.LOG_DEBUG, "Set implementation object for component {0}", new Object[] { getName() },  null );
 
             //notify that component was successfully created so any optional circular dependencies can be retried
-            BundleComponentActivator activator = getActivator();
+            ComponentActivator activator = getActivator();
             if ( activator != null )
             {
                 activator.missingServicePresent( getServiceReference() );

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/ComponentMetadata.java Fri May 20 13:43:39 2016
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.felix.scr.impl.TargetedPID;
+import org.apache.felix.scr.impl.config.TargetedPID;
 import org.apache.felix.scr.impl.helper.Logger;
 import org.apache.felix.scr.impl.metadata.ServiceMetadata.Scope;
 import org.osgi.service.component.ComponentException;

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java Fri May 20 13:43:39 2016
@@ -1,69 +1,69 @@
-/*
- * 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.scr.impl.parser;
-
-import org.apache.felix.scr.impl.parser.KXml2SAXParser.Attributes;
-
-/**
- * Interface for a SAX like handler with kXML
- */
-public interface KXml2SAXHandler {
-
-   /**
-	* Method called when parsing text
-	*
-	* @param   text
-	* @exception   ParseException
-	*/
-   void characters(String text) throws ParseException;
-
-   /**
-	* Method called when a tag opens
-	*
-	* @param   uri
-	* @param   localName
-	* @param   attributes
-	* @exception   ParseException
-	*/
-	void startElement(
-		String uri,
-		String localName,
-		Attributes attributes)
-		throws ParseException;
-
-   /**
-	* Method called when a tag closes
-	*
-	* @param   uri
-	* @param   localName
-	* @exception   ParseException
-	*/
-    void endElement(
-		String uri,
-		String localName)
-		throws ParseException;
-
-    void processingInstruction(String target,
-									  String data)
-							   throws Exception;
-
-	void setLineNumber(int lineNumber);
-
-	void setColumnNumber(int columnNumber);
-}
+/*
+ * 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.scr.impl.parser;
+
+import org.apache.felix.scr.impl.parser.KXml2SAXParser.Attributes;
+
+/**
+ * Interface for a SAX like handler with kXML
+ */
+public interface KXml2SAXHandler {
+
+   /**
+	* Method called when parsing text
+	*
+	* @param   text
+	* @exception   ParseException
+	*/
+   void characters(String text) throws ParseException;
+
+   /**
+	* Method called when a tag opens
+	*
+	* @param   uri
+	* @param   localName
+	* @param   attributes
+	* @exception   ParseException
+	*/
+	void startElement(
+		String uri,
+		String localName,
+		Attributes attributes)
+		throws ParseException;
+
+   /**
+	* Method called when a tag closes
+	*
+	* @param   uri
+	* @param   localName
+	* @exception   ParseException
+	*/
+    void endElement(
+		String uri,
+		String localName)
+		throws ParseException;
+
+    void processingInstruction(String target,
+									  String data)
+							   throws Exception;
+
+	void setLineNumber(int lineNumber);
+
+	void setColumnNumber(int columnNumber);
+}

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java Fri May 20 13:43:39 2016
@@ -1,165 +1,165 @@
-/*
- * 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.scr.impl.parser;
-
-
-import java.io.Reader;
-import java.util.Stack;
-
-import org.kxml2.io.KXmlParser;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-
-/**
- * The KXml2SAXParser extends the XmlParser from kxml. This is a very
- * simple parser that does not take into account the DTD
- *
- */
-public class KXml2SAXParser extends KXmlParser
-{
-
-    /**
-    * The constructor for a parser, it receives a java.io.Reader.
-    *
-    * @param   reader  The reader
-    * @throws XmlPullParserException
-    */
-    public KXml2SAXParser( Reader reader ) throws XmlPullParserException
-    {
-        super();
-        setInput( reader );
-        setFeature( FEATURE_PROCESS_NAMESPACES, true );
-    }
-
-
-    /**
-    * Parser from the reader provided in the constructor, and call
-    * the startElement and endElement in a KxmlHandler
-    *
-    * @param   handler  The handler
-    * @exception   Exception thrown by the superclass
-    */
-    public void parseXML( KXml2SAXHandler handler ) throws Exception
-    {
-
-        final Stack<XmlElement> openElements = new Stack<XmlElement>();
-        XmlElement currentElement = null;
-        final Attributes attributes = new Attributes();
-
-        while ( next() != XmlPullParser.END_DOCUMENT )
-        {
-            handler.setLineNumber( getLineNumber() );
-            handler.setColumnNumber( getColumnNumber() );
-
-            if ( getEventType() == XmlPullParser.START_TAG )
-            {
-                currentElement = new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() );
-                openElements.push( currentElement );
-
-                handler.startElement( getNamespace(), getName(), attributes );
-            }
-            else if ( getEventType() == XmlPullParser.END_TAG )
-            {
-                ensureMatchingCurrentElement(currentElement);
-                openElements.pop();
-                currentElement = openElements.isEmpty() ? null : ( XmlElement ) openElements.peek();
-
-                handler.endElement( getNamespace(), getName() );
-            }
-            else if ( getEventType() == XmlPullParser.TEXT )
-            {
-                String text = getText();
-                handler.characters( text );
-            }
-            else if ( getEventType() == XmlPullParser.PROCESSING_INSTRUCTION )
-            {
-                // TODO extract the target from the evt.getText()
-                handler.processingInstruction( null, getText() );
-            }
-            else
-            {
-                // do nothing
-            }
-        }
-
-        if ( !openElements.isEmpty() )
-        {
-            throw new ParseException( "Unclosed elements found: " + openElements, null );
-        }
-    }
-
-
-    private void ensureMatchingCurrentElement( final XmlElement currentElement ) throws Exception
-    {
-        if ( currentElement == null )
-        {
-            throw new ParseException( "Unexpected closing element "
-                + new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() ), null );
-        }
-
-        if ( !currentElement.match( getNamespace(), getName() ) )
-        {
-            throw new ParseException( "Unexpected closing element "
-                + new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() )
-                + ": Does not match opening element " + currentElement, null );
-        }
-    }
-
-    private static class XmlElement
-    {
-
-        final String namespaceUri;
-        final String name;
-        final int line;
-        final int col;
-
-
-        XmlElement( final String namespaceUri, final String name, final int line, final int col )
-        {
-            this.namespaceUri = namespaceUri;
-            this.name = name;
-            this.line = line;
-            this.col = col;
-        }
-
-
-        boolean match( final String namespaceUri, final String name )
-        {
-            return namespaceUri.equals( this.namespaceUri ) && name.equals( this.name );
-        }
-
-        public String toString()
-        {
-            return name + "@" + line + ":" + col;
-        }
-    }
-    
-    public class Attributes {
-    	
-    	public String getAttribute(String name) {
-    		return getAttributeValue("", name);
-    	}
-    	
-    	public String getAttribute(String uri, String name) {
-    		return getAttributeValue(uri, name);
-    	}
-
-    }
-}
+/*
+ * 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.scr.impl.parser;
+
+
+import java.io.Reader;
+import java.util.Stack;
+
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+
+/**
+ * The KXml2SAXParser extends the XmlParser from kxml. This is a very
+ * simple parser that does not take into account the DTD
+ *
+ */
+public class KXml2SAXParser extends KXmlParser
+{
+
+    /**
+    * The constructor for a parser, it receives a java.io.Reader.
+    *
+    * @param   reader  The reader
+    * @throws XmlPullParserException
+    */
+    public KXml2SAXParser( Reader reader ) throws XmlPullParserException
+    {
+        super();
+        setInput( reader );
+        setFeature( FEATURE_PROCESS_NAMESPACES, true );
+    }
+
+
+    /**
+    * Parser from the reader provided in the constructor, and call
+    * the startElement and endElement in a KxmlHandler
+    *
+    * @param   handler  The handler
+    * @exception   Exception thrown by the superclass
+    */
+    public void parseXML( KXml2SAXHandler handler ) throws Exception
+    {
+
+        final Stack<XmlElement> openElements = new Stack<XmlElement>();
+        XmlElement currentElement = null;
+        final Attributes attributes = new Attributes();
+
+        while ( next() != XmlPullParser.END_DOCUMENT )
+        {
+            handler.setLineNumber( getLineNumber() );
+            handler.setColumnNumber( getColumnNumber() );
+
+            if ( getEventType() == XmlPullParser.START_TAG )
+            {
+                currentElement = new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() );
+                openElements.push( currentElement );
+
+                handler.startElement( getNamespace(), getName(), attributes );
+            }
+            else if ( getEventType() == XmlPullParser.END_TAG )
+            {
+                ensureMatchingCurrentElement(currentElement);
+                openElements.pop();
+                currentElement = openElements.isEmpty() ? null : ( XmlElement ) openElements.peek();
+
+                handler.endElement( getNamespace(), getName() );
+            }
+            else if ( getEventType() == XmlPullParser.TEXT )
+            {
+                String text = getText();
+                handler.characters( text );
+            }
+            else if ( getEventType() == XmlPullParser.PROCESSING_INSTRUCTION )
+            {
+                // TODO extract the target from the evt.getText()
+                handler.processingInstruction( null, getText() );
+            }
+            else
+            {
+                // do nothing
+            }
+        }
+
+        if ( !openElements.isEmpty() )
+        {
+            throw new ParseException( "Unclosed elements found: " + openElements, null );
+        }
+    }
+
+
+    private void ensureMatchingCurrentElement( final XmlElement currentElement ) throws Exception
+    {
+        if ( currentElement == null )
+        {
+            throw new ParseException( "Unexpected closing element "
+                + new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() ), null );
+        }
+
+        if ( !currentElement.match( getNamespace(), getName() ) )
+        {
+            throw new ParseException( "Unexpected closing element "
+                + new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() )
+                + ": Does not match opening element " + currentElement, null );
+        }
+    }
+
+    private static class XmlElement
+    {
+
+        final String namespaceUri;
+        final String name;
+        final int line;
+        final int col;
+
+
+        XmlElement( final String namespaceUri, final String name, final int line, final int col )
+        {
+            this.namespaceUri = namespaceUri;
+            this.name = name;
+            this.line = line;
+            this.col = col;
+        }
+
+
+        boolean match( final String namespaceUri, final String name )
+        {
+            return namespaceUri.equals( this.namespaceUri ) && name.equals( this.name );
+        }
+
+        public String toString()
+        {
+            return name + "@" + line + ":" + col;
+        }
+    }
+    
+    public class Attributes {
+    	
+    	public String getAttribute(String name) {
+    		return getAttributeValue("", name);
+    	}
+    	
+    	public String getAttribute(String uri, String name) {
+    		return getAttributeValue(uri, name);
+    	}
+
+    }
+}

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/config/ConfiguredComponentHolderTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/config/ConfiguredComponentHolderTest.java?rev=1744735&r1=1744734&r2=1744735&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/config/ConfiguredComponentHolderTest.java (original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/config/ConfiguredComponentHolderTest.java Fri May 20 13:43:39 2016
@@ -28,7 +28,6 @@ import java.util.Map;
 
 import junit.framework.TestCase;
 
-import org.apache.felix.scr.impl.TargetedPID;
 import org.apache.felix.scr.impl.helper.ComponentMethods;
 import org.apache.felix.scr.impl.manager.SingleComponentManager;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;