You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gn...@apache.org on 2009/04/29 11:28:49 UTC
svn commit: r769728 - in /geronimo/sandbox/blueprint:
blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/
blueprint-cm/src/main/resources/org/apache/geronimo/blueprint/compendium/cm/
blueprint-core/src/main/java/org/apache/geronimo/blueprin...
Author: gnodet
Date: Wed Apr 29 09:28:43 2009
New Revision: 769728
URL: http://svn.apache.org/viewvc?rev=769728&view=rev
Log:
Update to latest schema / api
Modified:
geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java
geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/org/apache/geronimo/blueprint/compendium/cm/blueprint-cm.xsd
geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java
geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml
geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml
Modified: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java (original)
+++ geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java Wed Apr 29 09:28:43 2009
@@ -16,6 +16,8 @@
*/
package org.osgi.service.blueprint.reflect;
-public interface RefMetadata extends Target, IdRefMetadata {
+public interface RefMetadata extends Target, NonNullMetadata {
+
+ String getComponentId();
}
Modified: geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/org/apache/geronimo/blueprint/compendium/cm/blueprint-cm.xsd
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/org/apache/geronimo/blueprint/compendium/cm/blueprint-cm.xsd?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/org/apache/geronimo/blueprint/compendium/cm/blueprint-cm.xsd (original)
+++ geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/org/apache/geronimo/blueprint/compendium/cm/blueprint-cm.xsd Wed Apr 29 09:28:43 2009
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
/*
- * $Revision: 6871 $
+ * $Revision: 6879 $
*
* Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
*
@@ -20,13 +20,13 @@
-->
<xsd:schema xmlns="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:osgi="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
targetNamespace="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.0.0">
- <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0"/>
+ <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0" schemaLocation="../../blueprint/v1.0.0/blueprint.xsd"/>
<!-- property placeholder -->
@@ -34,7 +34,7 @@
<xsd:complexType name="TpropertyPlaceholder">
<xsd:complexContent>
- <xsd:extension base="osgi:Tcomponent">
+ <xsd:extension base="bp:Tcomponent">
<xsd:sequence>
<!-- nested properties declaration -->
<xsd:element name="default-properties" type="TdefaultProperties" minOccurs="0" maxOccurs="1"/>
@@ -44,7 +44,7 @@
<xsd:attribute name="persistent-id" type="xsd:string" use="required"/>
<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="osgi:Tidref" use="optional"/>
+ <xsd:attribute name="defaults-ref" type="bp:Tidref" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -55,7 +55,7 @@
all of the elements you can inject into a bean property? -->
<xsd:complexType name="TdefaultProperties">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="property" type="osgi:Tproperty"/>
+ <xsd:element name="property" type="bp:Tproperty"/>
</xsd:sequence>
</xsd:complexType>
@@ -84,14 +84,14 @@
<xsd:complexType name="TmanagedServiceFactory">
<xsd:complexContent>
- <xsd:extension base="osgi:Tcomponent">
+ <xsd:extension base="bp:Tcomponent">
<xsd:sequence>
- <xsd:group ref="osgi:serviceElements"/>
+ <xsd:group ref="bp:serviceElements"/>
<xsd:element name="managed-component" type="TmanagedComponent" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="factory-pid" type="xsd:string" use="required"/>
- <xsd:attribute name="interface" type="osgi:Tclass" use="optional"/>
- <xsd:attribute name="auto-export" type="osgi:TautoExportModes" default="disabled"/>
+ <xsd:attribute name="interface" type="bp:Tclass" use="optional"/>
+ <xsd:attribute name="auto-export" type="bp:TautoExportModes" default="disabled"/>
<xsd:attribute name="ranking" type="xsd:int" default="0"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:extension>
@@ -99,12 +99,12 @@
</xsd:complexType>
<xsd:complexType name="TmanagedComponent">
- <xsd:group ref="osgi:beanElements"/>
- <xsd:attribute name="class" type="osgi:Tclass"/>
- <xsd:attribute name="init-method" type="osgi:Tmethod"/>
- <xsd:attribute name="destroy-method" type="osgi:Tmethod"/>
- <xsd:attribute name="factory-method" type="osgi:Tmethod"/>
- <xsd:attribute name="factory-component" type="osgi:Tidref"/>
+ <xsd:group ref="bp:beanElements"/>
+ <xsd:attribute name="class" type="bp:Tclass"/>
+ <xsd:attribute name="init-method" type="bp:TnullableMethod"/>
+ <xsd:attribute name="destroy-method" type="bp:TnullableMethod"/>
+ <xsd:attribute name="factory-method" type="bp:Tmethod"/>
+ <xsd:attribute name="factory-component" type="bp:Tidref"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java Wed Apr 29 09:28:43 2009
@@ -89,6 +89,9 @@
/**
* TODO: javadoc
*
+ * TODO: cache DocumentBuilderFactory and SchemaFactory in static variables
+ * TODO: option to disable validation
+ *
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
@@ -651,13 +654,11 @@
if (!element.hasAttribute(KEY_ATTRIBUTE)) {
throw new ComponentDefinitionException(KEY_ATTRIBUTE + " attribute is required");
}
- String value = null;
- if (element.hasAttribute(VALUE_ATTRIBUTE)) {
- value = element.getAttribute(VALUE_ATTRIBUTE);
- } else {
- value = getTextValue(element);
+ if (!element.hasAttribute(VALUE_ATTRIBUTE)) {
+ throw new ComponentDefinitionException(VALUE_ATTRIBUTE + " attribute is required");
}
String key = element.getAttribute(KEY_ATTRIBUTE);
+ String value = element.getAttribute(VALUE_ATTRIBUTE);
return new MapEntryImpl(new ValueMetadataImpl(key, String.class.getName()),
new ValueMetadataImpl(value, String.class.getName()));
}
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java Wed Apr 29 09:28:43 2009
@@ -27,17 +27,27 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class RefMetadataImpl extends IdRefMetadataImpl implements MutableRefMetadata {
+public class RefMetadataImpl implements MutableRefMetadata {
+
+ protected String componentId;
public RefMetadataImpl() {
}
public RefMetadataImpl(String componentId) {
- super(componentId);
+ this.componentId = componentId;
}
public RefMetadataImpl(RefMetadata source) {
- super(source);
+ componentId = source.getComponentId();
+ }
+
+ public String getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(String componentId) {
+ this.componentId = componentId;
}
@Override
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd Wed Apr 29 09:28:43 2009
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
/*
- * $Revision: 6871 $
+ * $Revision: 6890 $
*
* Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
*
@@ -101,8 +101,8 @@
<xsd:group ref="beanElements"/>
<xsd:attribute name="class" type="Tclass"/>
<xsd:attribute name="depends-on" type="xsd:normalizedString"/>
- <xsd:attribute name="init-method" type="Tmethod"/>
- <xsd:attribute name="destroy-method" type="Tmethod"/>
+ <xsd:attribute name="init-method" type="TnullableMethod"/>
+ <xsd:attribute name="destroy-method" type="TnullableMethod"/>
<xsd:attribute name="factory-method" type="Tmethod"/>
<xsd:attribute name="factory-component" type="Tidref"/>
@@ -208,6 +208,7 @@
use="optional"/>
<xsd:attribute name="availability" type="Tavailability"
use="optional" default="mandatory"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -256,6 +257,7 @@
<xsd:attribute name="depends-on" type="xsd:normalizedString" use="optional"/>
<xsd:attribute name="auto-export" type="TautoExportModes" default="disabled"/>
<xsd:attribute name="ranking" type="xsd:int" default="0"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -344,11 +346,9 @@
</xsd:sequence>
</xsd:complexType>
- <xsd:complexType name="Tprop" mixed="true">
- <xsd:attribute name="key" type="TstringValue"
- use="required"/>
- <xsd:attribute name="value" type="TstringValue"
- use="optional"/>
+ <xsd:complexType name="Tprop">
+ <xsd:attribute name="key" type="TstringValue" use="required"/>
+ <xsd:attribute name="value" type="TstringValue" use="required"/>
</xsd:complexType>
<!-- 'map' element type -->
@@ -402,6 +402,14 @@
</xsd:simpleType>
<!-- Should be used for all attributes and elements that refer to method names -->
+ <xsd:simpleType name="TnullableMethod">
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="[\i-[:]][\c-[:]]*"/>
+ <xsd:pattern value=""/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <!-- Should be used for all attributes and elements that refer to method names -->
<xsd:simpleType name="Tidref">
<xsd:restriction base="xsd:NCName"/>
</xsd:simpleType>
Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java Wed Apr 29 09:28:43 2009
@@ -91,7 +91,6 @@
assertNotNull(pojoa.getProps());
assertEquals("value1", pojoa.getProps().get("key1"));
assertEquals("value2", pojoa.getProps().get("2"));
- assertEquals("bar", pojoa.getProps().get("foo"));
assertNotNull(pojoa.getNumber());
assertEquals(new BigInteger("10"), pojoa.getNumber());
Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml Wed Apr 29 09:28:43 2009
@@ -31,16 +31,9 @@
</property>
</bean>
- <!-- TODO: destroy-method="" does not pass schema validation for now
<bean id="pojoB" class="org.apache.geronimo.blueprint.pojos.PojoA" init-method="initPojo" destroy-method="" >
<argument index = "1" value="val0"/>
<argument index = "0" ref="val1" />
</bean>
- -->
-
- <bean id="pojoB" class="org.apache.geronimo.blueprint.pojos.PojoA" init-method="initPojo" >
- <argument index = "1" value="val0"/>
- <argument index = "0" ref="val1" />
- </bean>
</blueprint>
\ No newline at end of file
Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml?rev=769728&r1=769727&r2=769728&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml Wed Apr 29 09:28:43 2009
@@ -57,7 +57,6 @@
<props>
<prop key="key1" value="value1" />
<prop key="2" value="value2" />
- <prop key="foo">bar</prop>
</props>
</property>
<property name="array">