You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by gn...@apache.org on 2010/09/28 21:06:57 UTC
svn commit: r1002327 - in
/incubator/aries/trunk/blueprint/blueprint-cm/src/main:
java/org/apache/aries/blueprint/compendium/cm/ resources/OSGI-INF/blueprint/
resources/org/apache/aries/blueprint/compendium/cm/
Author: gnodet
Date: Tue Sep 28 19:06:56 2010
New Revision: 1002327
URL: http://svn.apache.org/viewvc?rev=1002327&view=rev
Log:
[ARIES-429] Use a new version for the cm schema for the new attribute
Added:
incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.0.0.xsd
- copied, changed from r1002318, incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd
incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.1.0.xsd
- copied, changed from r1002318, incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd
Removed:
incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd
Modified:
incubator/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml
Modified: incubator/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java?rev=1002327&r1=1002326&r2=1002327&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java (original)
+++ incubator/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java Tue Sep 28 19:06:56 2010
@@ -79,7 +79,8 @@ import org.slf4j.LoggerFactory;
public class CmNamespaceHandler implements NamespaceHandler {
public static final String BLUEPRINT_NAMESPACE = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
- public static final String BLUEPRINT_CM_NAMESPACE = "http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0";
+ public static final String BLUEPRINT_CM_NAMESPACE_1_0 = "http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0";
+ public static final String BLUEPRINT_CM_NAMESPACE_1_1 = "http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0";
public static final String PROPERTY_PLACEHOLDER_ELEMENT = "property-placeholder";
public static final String MANAGED_PROPERTIES_ELEMENT = "managed-properties";
@@ -138,7 +139,13 @@ public class CmNamespaceHandler implemen
}
public URL getSchemaLocation(String namespace) {
- return getClass().getResource("blueprint-cm.xsd");
+ if (BLUEPRINT_CM_NAMESPACE_1_1.equals(namespace)) {
+ return getClass().getResource("blueprint-cm-1.1.0.xsd");
+ } else if (BLUEPRINT_CM_NAMESPACE_1_0.equals(namespace)) {
+ return getClass().getResource("blueprint-cm-1.0.0.xsd");
+ } else {
+ return null;
+ }
}
public Set<Class> getManagedClasses() {
@@ -226,7 +233,8 @@ public class CmNamespaceHandler implemen
Node node = nl.item(i);
if (node instanceof Element) {
Element e = (Element) node;
- if (BLUEPRINT_CM_NAMESPACE.equals(e.getNamespaceURI())) {
+ if (BLUEPRINT_CM_NAMESPACE_1_0.equals(e.getNamespaceURI())
+ || BLUEPRINT_CM_NAMESPACE_1_1.equals(e.getNamespaceURI())) {
if (nodeNameEquals(e, DEFAULT_PROPERTIES_ELEMENT)) {
if (defaultsRef != null) {
throw new ComponentDefinitionException("Only one of " + DEFAULTS_REF_ATTRIBUTE + " attribute or " + DEFAULT_PROPERTIES_ELEMENT + " element is allowed");
@@ -257,7 +265,8 @@ public class CmNamespaceHandler implemen
Node node = nl.item(i);
if (node instanceof Element) {
Element e = (Element) node;
- if (BLUEPRINT_CM_NAMESPACE.equals(e.getNamespaceURI())) {
+ if (BLUEPRINT_CM_NAMESPACE_1_0.equals(e.getNamespaceURI())
+ || BLUEPRINT_CM_NAMESPACE_1_1.equals(e.getNamespaceURI())) {
if (nodeNameEquals(e, PROPERTY_ELEMENT)) {
BeanProperty prop = context.parseElement(BeanProperty.class, enclosingComponent, e);
props.addEntry(createValue(context, prop.getName(), String.class.getName()), prop.getValue());
@@ -325,7 +334,8 @@ public class CmNamespaceHandler implemen
} else if (nodeNameEquals(e, Parser.REGISTRATION_LISTENER_ELEMENT)) {
listeners.add(parser.parseRegistrationListener(e, factoryMetadata));
}
- } else if (BLUEPRINT_CM_NAMESPACE.equals(e.getNamespaceURI())) {
+ } else if (BLUEPRINT_CM_NAMESPACE_1_0.equals(e.getNamespaceURI())
+ || BLUEPRINT_CM_NAMESPACE_1_1.equals(e.getNamespaceURI())) {
if (nodeNameEquals(e, MANAGED_COMPONENT_ELEMENT)) {
MutableBeanMetadata managedComponent = context.parseElement(MutableBeanMetadata.class, null, e);
generateIdIfNeeded(context, managedComponent);
Modified: incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml?rev=1002327&r1=1002326&r2=1002327&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml (original)
+++ incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml Tue Sep 28 19:06:56 2010
@@ -21,7 +21,12 @@
<service interface="org.apache.aries.blueprint.NamespaceHandler">
<service-properties>
- <entry key="osgi.service.blueprint.namespace" value="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"/>
+ <entry key="osgi.service.blueprint.namespace">
+ <array>
+ <value>http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0</value>
+ <value>http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0</value>
+ </array>
+ </entry>
</service-properties>
<bean class="org.apache.aries.blueprint.compendium.cm.CmNamespaceHandler">
<property name="configAdmin">
Copied: incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.0.0.xsd (from r1002318, incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd)
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.0.0.xsd?p2=incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.0.0.xsd&p1=incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd&r1=1002318&r2=1002327&rev=1002327&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd (original)
+++ incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.0.0.xsd Tue Sep 28 19:06:56 2010
@@ -45,18 +45,9 @@
<xsd:attribute name="placeholder-prefix" type="xsd:string" use="optional" default="${"/>
<xsd:attribute name="placeholder-suffix" type="xsd:string" use="optional" default="}"/>
<xsd:attribute name="defaults-ref" type="bp:Tidref" use="optional"/>
- <xsd:attribute name="update-strategy" type="TplaceholderUpdateStrategyType" use="optional" default="none"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
-
- <xsd:simpleType name="TplaceholderUpdateStrategyType">
- <xsd:restriction base="xsd:NMTOKEN">
- <xsd:enumeration value="none"/>
- <xsd:enumeration value="reload"/>
- </xsd:restriction>
- </xsd:simpleType>
-
<!-- #### is this the correct type here? This is defining placeholder properties,
so should this be a restricted set of value types or should this be expanded to
Copied: incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.1.0.xsd (from r1002318, incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd)
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.1.0.xsd?p2=incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.1.0.xsd&p1=incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd&r1=1002318&r2=1002327&rev=1002327&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm.xsd (original)
+++ incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.1.0.xsd Tue Sep 28 19:06:56 2010
@@ -18,10 +18,10 @@
* limitations under the License.
*/
-->
-<xsd:schema xmlns="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+<xsd:schema xmlns="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- targetNamespace="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ targetNamespace="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.0.0">
@@ -49,7 +49,7 @@
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
-
+
<xsd:simpleType name="TplaceholderUpdateStrategyType">
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="none"/>
@@ -57,7 +57,6 @@
</xsd:restriction>
</xsd:simpleType>
-
<!-- #### is this the correct type here? This is defining placeholder properties,
so should this be a restricted set of value types or should this be expanded to
all of the elements you can inject into a bean property? -->