felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1638684 - in /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata: ComponentMetadata.java XmlHandler.java
Date Wed, 12 Nov 2014 01:36:52 GMT
Author: cziegeler
Date: Wed Nov 12 01:36:51 2014
New Revision: 1638684

URL: http://svn.apache.org/r1638684
Log:
FELIX-4686 : If component is declared with 1.3 NS and ds.factory.enabled = true, validation
error occors

Modified:
    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/metadata/XmlHandler.java

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=1638684&r1=1638683&r2=1638684&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
Wed Nov 12 01:36:51 2014
@@ -117,7 +117,7 @@ public class ComponentMetadata
     private boolean m_configurableServiceProperties;
     private boolean m_persistentFactoryComponent;
     private boolean m_deleteCallsModify;
-    private boolean m_obsoleteFactoryComponentFactory;
+    private Boolean m_obsoleteFactoryComponentFactory;
     private boolean m_configureWithInterfaces;
     private boolean m_delayedKeepInstances;
 
@@ -726,7 +726,7 @@ public class ComponentMetadata
 	}
 
 	public boolean isObsoleteFactoryComponentFactory() {
-		return m_obsoleteFactoryComponentFactory;
+		return m_obsoleteFactoryComponentFactory == null ? false : m_obsoleteFactoryComponentFactory;
 	}
 
 	public boolean isConfigureWithInterfaces() {
@@ -928,7 +928,7 @@ public class ComponentMetadata
         {
         	throw validationFailure("Configuration with interfaces or annotations only possible
with version 1.3 or later");
         }
-        if (m_dsVersion.isDS13() && m_obsoleteFactoryComponentFactory)
+        if (m_dsVersion.isDS13() && m_obsoleteFactoryComponentFactory != null)
         {
         	throw validationFailure("Configuration of component factory instances through config
admin factory pids supported only through the 1.2 namespace");
         }

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/XmlHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/XmlHandler.java?rev=1638684&r1=1638683&r2=1638684&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/XmlHandler.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/metadata/XmlHandler.java Wed Nov
12 01:36:51 2014
@@ -280,7 +280,14 @@ public class XmlHandler implements KXml2
                     m_currentComponent.setConfigurableServiceProperties("true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS,
CONFIGURABLE_SERVICE_PROPERTIES)));
                     m_currentComponent.setPersistentFactoryComponent("true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS,
PERSISTENT_FACTORY_COMPONENT)));
                     m_currentComponent.setDeleteCallsModify("true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS,
DELETE_CALLS_MODIFY)));
-                    m_currentComponent.setObsoleteFactoryComponentFactory(m_globalObsoleteFactoryComponentFactory
||  "true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS, OBSOLETE_FACTORY_COMPONENT_FACTORY)));
+                    if ( attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS) != null)
+                    {
+                        m_currentComponent.setObsoleteFactoryComponentFactory("true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS,
OBSOLETE_FACTORY_COMPONENT_FACTORY)));
+                    }
+                    else if ( !namespaceCode.isDS13() )
+                    {
+                        m_currentComponent.setObsoleteFactoryComponentFactory(m_globalObsoleteFactoryComponentFactory);
+                    }
                     m_currentComponent.setConfigureWithInterfaces("true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS,
CONFIGURE_WITH_INTERFACES)));
                     m_currentComponent.setDelayedKeepInstances(m_globalDelayedKeepInstances
|| "true".equals(attributes.getAttribute(NAMESPACE_URI_1_0_FELIX_EXTENSIONS, DELAYED_KEEP_INSTANCES)));
 



Mime
View raw message