geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r782099 - 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...
Date Fri, 05 Jun 2009 18:50:21 GMT
Author: gnodet
Date: Fri Jun  5 18:50:20 2009
New Revision: 782099

URL: http://svn.apache.org/viewvc?rev=782099&view=rev
Log:
Remove ref-set support and ordered collection support

Added:
    geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java   (contents, props changed)
      - copied, changed from r781861, geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefListMetadata.java
      - copied, changed from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefCollectionMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java
      - copied, changed from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefCollectionRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefListMetadata.java
      - copied, changed from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefCollectionMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefListMetadataImpl.java
      - copied, changed from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java
Removed:
    geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefCollectionMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefCollectionRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefCollectionMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java
Modified:
    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/container/AbstractServiceReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/AbstractPropertyPlaceholder.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/ExtNamespaceHandler.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/DynamicCollection.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/utils/DynamicCollectionTest.java

Copied: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java (from r781861, geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java?p2=geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java&p1=geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java&r1=781861&r2=782099&rev=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java (original)
+++ geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java Fri Jun  5 18:50:20 2009
@@ -16,18 +16,12 @@
  */
 package org.osgi.service.blueprint.reflect;
 
-public interface RefCollectionMetadata extends ServiceReferenceMetadata {
+public interface RefListMetadata extends ServiceReferenceMetadata {
 
     static final int USE_SERVICE_OBJECT = 1;
 
     static final int USE_SERVICE_REFERENCE = 2;
 
-    Class getCollectionType();
-
-    Target getComparator();
-
-    int getOrderingBasis();
-
     int getMemberType();
 
 }

Propchange: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=782099&r1=782098&r2=782099&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 Fri Jun  5 18:50:20 2009
@@ -86,14 +86,15 @@
         <xsd:complexContent>
             <xsd:extension base="bp:Tcomponent">
                 <xsd:sequence>
-                    <xsd:group ref="bp:serviceElements"/>
+                    <xsd:group ref="bp:baseServiceElements"/>
                     <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="bp:Tclass" use="optional"/>
-                <xsd:attribute name="auto-export" type="bp:TautoExportModes" default="disabled"/>
+                <xsd:attribute name="interface" type="bp:Tclass" use="optional" />
+                <xsd:attribute name="ref" type="bp:Tidref" 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:attribute name="factory-pid" type="xsd:string" use="required"/>
+                <xsd:anyAttribute namespace="##other" processContents="strict"/>
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>
@@ -105,7 +106,7 @@
         <xsd:attribute name="destroy-method" type="bp:Tmethod"/>
         <xsd:attribute name="factory-method" type="bp:Tmethod"/>
         <xsd:attribute name="factory-component" type="bp:Tidref"/>
-        <xsd:anyAttribute namespace="##other" processContents="lax"/>
+        <xsd:anyAttribute namespace="##other" processContents="strict"/>
     </xsd:complexType>
 
 

Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefListMetadata.java (from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefCollectionMetadata.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefListMetadata.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefListMetadata.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefCollectionMetadata.java&r1=781861&r2=782099&rev=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefCollectionMetadata.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedRefListMetadata.java Fri Jun  5 18:50:20 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.blueprint;
 
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 
 /**
  * TODO: javadoc
@@ -24,7 +24,7 @@
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 766508 $, $Date: 2009-04-19 22:09:27 +0200 (Sun, 19 Apr 2009) $
  */
-public interface ExtendedRefCollectionMetadata extends RefCollectionMetadata, ExtendedServiceReferenceMetadata {
+public interface ExtendedRefListMetadata extends RefListMetadata, ExtendedServiceReferenceMetadata {
 
     int PROXY_METHOD_GREEDY = 2;
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java Fri Jun  5 18:50:20 2009
@@ -62,7 +62,7 @@
  */
 public abstract class AbstractServiceReferenceRecipe extends AbstractRecipe implements ServiceListener, SatisfiableRecipe {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(RefCollectionRecipe.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(RefListRecipe.class);
 
     protected final ExtendedBlueprintContainer blueprintContainer;
     protected final ServiceReferenceMetadata metadata;

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java Fri Jun  5 18:50:20 2009
@@ -36,7 +36,6 @@
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.geronimo.blueprint.BeanProcessor;
 import org.apache.geronimo.blueprint.BlueprintConstants;
 import org.apache.geronimo.blueprint.ComponentDefinitionRegistryProcessor;
 import org.apache.geronimo.blueprint.ExtendedBeanMetadata;
@@ -71,13 +70,12 @@
 import org.osgi.service.blueprint.reflect.MapMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
 import org.osgi.service.blueprint.reflect.PropsMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.reflect.RefMetadata;
 import org.osgi.service.blueprint.reflect.RegistrationListener;
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
 import org.osgi.service.blueprint.reflect.Target;
-import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -617,9 +615,6 @@
                 getMetadata(clazz, l.getListenerComponent(), metadatas);
             }
         }
-        if (component instanceof RefCollectionMetadata) {
-            getMetadata(clazz, ((RefCollectionMetadata) component).getComparator(), metadatas);
-        }
         if (component instanceof ServiceMetadata) {
             getMetadata(clazz, ((ServiceMetadata) component).getServiceComponent(), metadatas);
             for (MapEntry m : ((ServiceMetadata) component).getServiceProperties()) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java Fri Jun  5 18:50:20 2009
@@ -61,7 +61,7 @@
 import org.apache.geronimo.blueprint.reflect.MapMetadataImpl;
 import org.apache.geronimo.blueprint.reflect.MetadataUtil;
 import org.apache.geronimo.blueprint.reflect.PropsMetadataImpl;
-import org.apache.geronimo.blueprint.reflect.RefCollectionMetadataImpl;
+import org.apache.geronimo.blueprint.reflect.RefListMetadataImpl;
 import org.apache.geronimo.blueprint.reflect.RefMetadataImpl;
 import org.apache.geronimo.blueprint.reflect.ReferenceMetadataImpl;
 import org.apache.geronimo.blueprint.reflect.RegistrationListenerImpl;
@@ -81,7 +81,7 @@
 import org.osgi.service.blueprint.reflect.NonNullMetadata;
 import org.osgi.service.blueprint.reflect.NullMetadata;
 import org.osgi.service.blueprint.reflect.PropsMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.reflect.RegistrationListener;
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
@@ -125,14 +125,12 @@
     public static final String SERVICE_ELEMENT = "service";
     public static final String REFERENCE_ELEMENT = "reference";
     public static final String REFLIST_ELEMENT = "ref-list";
-    public static final String REFSET_ELEMENT = "ref-set";
     public static final String INTERFACES_ELEMENT = "interfaces";
     public static final String LISTENER_ELEMENT = "listener";
     public static final String SERVICE_PROPERTIES_ELEMENT = "service-properties";
     public static final String REGISTRATION_LISTENER_ELEMENT = "registration-listener";
     public static final String ENTRY_ELEMENT = "entry";
     public static final String KEY_ELEMENT = "key";
-    public static final String COMPARATOR_ELEMENT = "comparator";
     public static final String DEFAULT_INITIALIZATION_ATTRIBUTE = "default-initialization";
     public static final String DEFAULT_TIMEOUT_ATTRIBUTE = "default-timeout";
     public static final String DEFAULT_AVAILABILITY_ATTRIBUTE = "default-availability";
@@ -162,9 +160,7 @@
     public static final String UNBIND_METHOD_ATTRIBUTE = "unbind-method";
     public static final String KEY_TYPE_ATTRIBUTE = "key-type";
     public static final String VALUE_TYPE_ATTRIBUTE = "value-type";
-    public static final String COMPARATOR_REF_ATTRIBUTE = "comparator-ref";
     public static final String MEMBER_TYPE_ATTRIBUTE = "member-type";
-    public static final String ORDERING_BASIS_ATTRIBUTE = "ordering-basis";
     public static final String SCOPE_ATTRIBUTE = "scope";
     public static final String INIT_METHOD_ATTRIBUTE = "init-method";
     public static final String DESTROY_METHOD_ATTRIBUTE = "destroy-method";
@@ -395,8 +391,8 @@
             return type.cast(parseProps(element));
         } else if (ReferenceMetadata.class.isAssignableFrom(type)) {
             return type.cast(parseReference(element, enclosingComponent == null));
-        } else if (RefCollectionMetadata.class.isAssignableFrom(type)) {
-            return type.cast(parseRefCollection(element, List.class, enclosingComponent == null));
+        } else if (RefListMetadata.class.isAssignableFrom(type)) {
+            return type.cast(parseRefList(element, enclosingComponent == null));
         } else if (IdRefMetadata.class.isAssignableFrom(type)) {
             return type.cast(parseIdRef(element));
         } else if (RefMetadata.class.isAssignableFrom(type)) {
@@ -423,10 +419,7 @@
             ComponentMetadata reference = parseReference(element, true);
             registry.registerComponentDefinition(reference);
         } else if (nodeNameEquals(element, REFLIST_ELEMENT) ) {
-            ComponentMetadata references = parseRefCollection(element, List.class, true);
-            registry.registerComponentDefinition(references);
-        } else if (nodeNameEquals(element, REFSET_ELEMENT)) {
-            ComponentMetadata references = parseRefCollection(element, Set.class, true);
+            ComponentMetadata references = parseRefList(element, true);
             registry.registerComponentDefinition(references);
         } else {
             throw new ComponentDefinitionException("Unknown element " + element.getNodeName() + " in namespace " + BLUEPRINT_NAMESPACE);
@@ -879,47 +872,21 @@
         return r;
     }
 
-    private ComponentMetadata parseRefCollection(Element element, Class collectionType, boolean topElement) {
-        RefCollectionMetadataImpl references = new RefCollectionMetadataImpl();
+    private ComponentMetadata parseRefList(Element element, boolean topElement) {
+        RefListMetadataImpl references = new RefListMetadataImpl();
         if (topElement) {
             references.setId(getId(element));
         }
-        references.setCollectionType(collectionType);
-
-        if (element.hasAttribute(COMPARATOR_REF_ATTRIBUTE)) {
-            references.setComparator(new RefMetadataImpl(element.getAttribute(COMPARATOR_REF_ATTRIBUTE)));
-        }
         if (element.hasAttribute(MEMBER_TYPE_ATTRIBUTE)) {
             String memberType = element.getAttribute(MEMBER_TYPE_ATTRIBUTE);
             if (USE_SERVICE_OBJECT.equals(memberType)) {
-                references.setMemberType(RefCollectionMetadata.USE_SERVICE_OBJECT);
+                references.setMemberType(RefListMetadata.USE_SERVICE_OBJECT);
             } else if (USE_SERVICE_REFERENCE.equals(memberType)) {
-                references.setMemberType(RefCollectionMetadata.USE_SERVICE_REFERENCE);
-            }
-        }
-        if (element.hasAttribute(ORDERING_BASIS_ATTRIBUTE)) {
-            String ordering = element.getAttribute(ORDERING_BASIS_ATTRIBUTE);
-            if (USE_SERVICE_OBJECT.equals(ordering)) {
-                references.setOrderingBasis(RefCollectionMetadata.USE_SERVICE_OBJECT);
-            } else if (USE_SERVICE_REFERENCE.equals(ordering)) {
-                references.setOrderingBasis(RefCollectionMetadata.USE_SERVICE_REFERENCE);
+                references.setMemberType(RefListMetadata.USE_SERVICE_REFERENCE);
             }
         }
         parseReference(element, references, topElement);
-        // Parse elements
-        NodeList nl = element.getChildNodes();
-        for (int i = 0; i < nl.getLength(); i++) {
-            Node node = nl.item(i);
-            if (node instanceof Element) {
-                Element e = (Element) node;
-                if (isBlueprintNamespace(e.getNamespaceURI())) {
-                    if (nodeNameEquals(e, COMPARATOR_ELEMENT)) {
-                        parseComparator(e, references);
-                    }
-                }
-            }
-        }
-        
+
         ComponentMetadata r = references;
         
         // Parse custom attributes
@@ -931,61 +898,6 @@
         return r;
     }
 
-    private void parseComparator(Element element, RefCollectionMetadataImpl references) {
-        Metadata comparator = references.getComparator();
-        // Parse attribute
-        if (element.hasAttribute(REF_ATTRIBUTE)) {
-            if (comparator != null) {
-                throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element can be set");
-            }
-            comparator = new RefMetadataImpl(element.getAttribute(REF_ATTRIBUTE));
-        }
-        // Parse elements
-        NodeList nl = element.getChildNodes();
-        for (int i = 0; i < nl.getLength(); i++) {
-            Node node = nl.item(i);
-            if (node instanceof Element) {
-                Element e = (Element) node;
-                if (isBlueprintNamespace(e.getNamespaceURI())) {
-                    if (nodeNameEquals(e, REF_ELEMENT)) {
-                        if (comparator != null) {
-                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element can be set");
-                        }
-                        String component = e.getAttribute(COMPONENT_ID_ATTRIBUTE);
-                        if (component == null || component.length() == 0) {
-                            throw new ComponentDefinitionException("Element " + REF_ELEMENT + " must have a valid " + COMPONENT_ID_ATTRIBUTE + " attribute");
-                        }
-                        comparator = new RefMetadataImpl(component);
-                    } else if (nodeNameEquals(e, BEAN_ELEMENT)) {
-                        if (comparator != null) {
-                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element can be set");
-                        }
-                        comparator = parseBeanMetadata(e, false);
-                    } else if (nodeNameEquals(e, REFERENCE_ELEMENT)) {
-                        if (comparator != null) {
-                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element can be set");
-                        }
-                        comparator = parseReference(e, false);
-                    } else if (nodeNameEquals(e, SERVICE_ELEMENT)) {
-                        if (comparator != null) {
-                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element can be set");
-                        }
-                        comparator = parseService(e, false);
-                    }
-                } else {
-                    if (comparator != null) {
-                        throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element can be set");
-                    }
-                    comparator = parseCustomElement(e, references);
-                }
-            }
-        }
-        if (comparator == null) {
-            throw new ComponentDefinitionException("One of " + REF_ATTRIBUTE + " attribute, " + REF_ELEMENT + ", " + BEAN_ELEMENT + ", " + REFERENCE_ELEMENT + ", " + SERVICE_ELEMENT + " or custom element must be set");
-        }
-        references.setComparator((Target) comparator);
-    }
-
     private void parseReference(Element element, ServiceReferenceMetadataImpl reference, boolean topElement) {
         // Parse attributes
         if (topElement) {
@@ -1149,9 +1061,7 @@
             } else if (nodeNameEquals(element, SERVICE_ELEMENT)) {
                 return parseService(element, false);
             } else if (nodeNameEquals(element, REFLIST_ELEMENT) ) {
-                return parseRefCollection(element, List.class, false);
-            } else if (nodeNameEquals(element, REFSET_ELEMENT)) {
-                return parseRefCollection(element, Set.class, false);
+                return parseRefList(element, false);
             } else if (nodeNameEquals(element, NULL_ELEMENT) && allowNull) {
                 return NullMetadata.NULL;
             } else if (nodeNameEquals(element, VALUE_ELEMENT)) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java Fri Jun  5 18:50:20 2009
@@ -52,7 +52,7 @@
 import org.osgi.service.blueprint.reflect.Metadata;
 import org.osgi.service.blueprint.reflect.NullMetadata;
 import org.osgi.service.blueprint.reflect.PropsMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.reflect.RefMetadata;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 import org.osgi.service.blueprint.reflect.RegistrationListener;
@@ -106,14 +106,14 @@
             return createServiceRecipe((ServiceMetadata) component);
         } else if (component instanceof ReferenceMetadata) {
             return createReferenceRecipe((ReferenceMetadata) component);
-        } else if (component instanceof RefCollectionMetadata) {
-            return createRefCollectionRecipe((RefCollectionMetadata) component);
+        } else if (component instanceof RefListMetadata) {
+            return createRefCollectionRecipe((RefListMetadata) component);
         } else {
             throw new IllegalStateException("Unsupported component type " + component.getClass());
         }
     }
 
-    private Recipe createRefCollectionRecipe(RefCollectionMetadata metadata) throws Exception {
+    private Recipe createRefCollectionRecipe(RefListMetadata metadata) throws Exception {
         CollectionRecipe listenersRecipe = null;
         if (metadata.getServiceListeners() != null) {
             listenersRecipe = new CollectionRecipe(getName(null), ArrayList.class);
@@ -121,15 +121,10 @@
                 listenersRecipe.add(createRecipe(listener));
             }
         }
-        Recipe comparatorRecipe = null;
-        if (metadata.getComparator() != null) {
-            comparatorRecipe = getValue(metadata.getComparator(), Comparator.class);
-        }
-        RefCollectionRecipe recipe = new RefCollectionRecipe(getName(metadata.getId()),
-                                                             blueprintContainer,
-                                                             metadata,
-                                                             listenersRecipe,
-                                                             comparatorRecipe);
+        RefListRecipe recipe = new RefListRecipe(getName(metadata.getId()),
+                                                 blueprintContainer,
+                                                 metadata,
+                                                 listenersRecipe);
         return recipe;
     }
 

Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java (from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefCollectionRecipe.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefCollectionRecipe.java&r1=781861&r2=782099&rev=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefCollectionRecipe.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java Fri Jun  5 18:50:20 2009
@@ -33,7 +33,7 @@
 import java.util.concurrent.Callable;
 
 import org.apache.geronimo.blueprint.ExtendedBlueprintContainer;
-import org.apache.geronimo.blueprint.ExtendedRefCollectionMetadata;
+import org.apache.geronimo.blueprint.ExtendedRefListMetadata;
 import org.apache.geronimo.blueprint.di.Recipe;
 import org.apache.geronimo.blueprint.utils.ConversionUtils;
 import org.apache.geronimo.blueprint.utils.DynamicCollection;
@@ -42,7 +42,7 @@
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.container.ServiceUnavailableException;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,49 +52,28 @@
  * @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 RefCollectionRecipe extends AbstractServiceReferenceRecipe {
+public class RefListRecipe extends AbstractServiceReferenceRecipe {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(RefCollectionRecipe.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(RefListRecipe.class);
 
-    private final RefCollectionMetadata metadata;
-    private final Recipe comparatorRecipe;
+    private final RefListMetadata metadata;
     private final List<ManagedCollection> collections = new ArrayList<ManagedCollection>();
     private DynamicCollection<ServiceDispatcher> storage;
     private final List<ServiceDispatcher> unboundDispatchers = new ArrayList<ServiceDispatcher>();
 
-    public RefCollectionRecipe(String name,
-                               ExtendedBlueprintContainer blueprintContainer,
-                               RefCollectionMetadata metadata,
-                               Recipe listenersRecipe,
-                               Recipe comparatorRecipe) {
+    public RefListRecipe(String name,
+                         ExtendedBlueprintContainer blueprintContainer,
+                         RefListMetadata metadata,
+                         Recipe listenersRecipe) {
         super(name, blueprintContainer, metadata, listenersRecipe);
         this.metadata = metadata;
-        this.comparatorRecipe = comparatorRecipe;
     }
 
     @Override
     protected Object internalCreate() throws ComponentDefinitionException {
         Comparator comparator = null;
         try {
-            if (comparatorRecipe != null) {
-                comparator = (Comparator) comparatorRecipe.create();
-            } else if (metadata.getOrderingBasis() != 0) {
-                comparator = new NaturalOrderComparator();
-            }
-            boolean orderReferences = metadata.getOrderingBasis() == RefCollectionMetadata.USE_SERVICE_REFERENCE;
-            boolean allowDuplicates;
-            if (metadata.getCollectionType() == List.class) {
-                allowDuplicates = true;
-            } else if (metadata.getCollectionType() == Set.class) {
-                allowDuplicates = false;
-            } else {
-                throw new IllegalArgumentException("Unsupported collection type " + metadata.getCollectionType().getName());
-            }
-            if (comparator != null) {
-                storage = new DynamicCollection<ServiceDispatcher>(allowDuplicates, new DispatcherComparator(comparator, orderReferences));
-            } else {
-                storage = new DynamicCollection<ServiceDispatcher>(allowDuplicates, null);
-            }
+            storage = new DynamicCollection<ServiceDispatcher>();
 
             // Handle initial references
             createListeners();
@@ -148,8 +127,8 @@
                 } else {
                     dispatcher = new ServiceDispatcher(reference);
                     List<String> interfaces = metadata.getInterfaceNames();
-                    if (metadata instanceof ExtendedRefCollectionMetadata) {
-                        boolean greedy = (((ExtendedRefCollectionMetadata) metadata).getProxyMethod() & ExtendedRefCollectionMetadata.PROXY_METHOD_GREEDY) != 0;
+                    if (metadata instanceof ExtendedRefListMetadata) {
+                        boolean greedy = (((ExtendedRefListMetadata) metadata).getProxyMethod() & ExtendedRefListMetadata.PROXY_METHOD_GREEDY) != 0;
                         if (greedy) {
                             interfaces = Arrays.asList((String[]) reference.getProperty(Constants.OBJECTCLASS));
                         }
@@ -207,12 +186,7 @@
                 return col;
             }
         }
-        ManagedCollection collection;
-        if (metadata.getCollectionType() == List.class) {
-            collection = new ManagedList(useReferences, storage);
-        } else {
-            collection = new ManagedSet(useReferences, storage);
-        }
+        ManagedCollection collection = new ManagedCollection(useReferences, storage);
         collections.add(collection);
         return collection;
     }
@@ -305,8 +279,8 @@
 
         public Object convert(Type type) {
             LOGGER.debug("Converting ManagedCollection to {}", type);
-            if (!TypeUtils.toClass(type).isAssignableFrom(metadata.getCollectionType())) {
-                throw new ComponentDefinitionException("<ref-list/> and <ref-set/> can only be converted respectively to a List or Set, not " + type);
+            if (!TypeUtils.toClass(type).isAssignableFrom(List.class)) {
+                throw new ComponentDefinitionException("<ref-list/> can only be converted to a List, not " + type);
             }
             boolean useRef = false;
             if (type instanceof ParameterizedType) {
@@ -315,10 +289,10 @@
                     useRef = (args[0] == ServiceReference.class);
                 }
             }
-            boolean references;   // TODO
-            if (metadata.getMemberType() == RefCollectionMetadata.USE_SERVICE_REFERENCE) {
+            boolean references;
+            if (metadata.getMemberType() == RefListMetadata.USE_SERVICE_REFERENCE) {
                 references = true;
-            } else if (metadata.getMemberType() == RefCollectionMetadata.USE_SERVICE_OBJECT) {
+            } else if (metadata.getMemberType() == RefListMetadata.USE_SERVICE_OBJECT) {
                 references = false;
             } else {
                 references = useRef;
@@ -331,10 +305,8 @@
 
     /**
      * Base class for managed collections.
-     * This class implemenents the Convertible interface to detect if the collection need
-     * to use ServiceReference or proxies.
      */
-    public static class ManagedCollection extends AbstractCollection {
+    public static class ManagedCollection extends AbstractCollection implements List, RandomAccess {
 
         protected final DynamicCollection<ServiceDispatcher> dispatchers;
         protected boolean references;
@@ -358,7 +330,7 @@
         }
 
         public Iterator iterator() {
-            return new ManagedIterator(dispatchers.iterator());
+            return new ManagedListIterator(dispatchers.iterator());
         }
 
         public int size() {
@@ -395,36 +367,6 @@
             throw new UnsupportedOperationException("This collection is read only");
         }
 
-        public class ManagedIterator implements Iterator {
-
-            private final Iterator<ServiceDispatcher> iterator;
-
-            public ManagedIterator(Iterator<ServiceDispatcher> iterator) {
-                this.iterator = iterator;
-            }
-
-            public boolean hasNext() {
-                return iterator.hasNext();
-            }
-
-            public Object next() {
-                return references ? iterator.next().reference : iterator.next().proxy;
-            }
-
-            public void remove() {
-                throw new UnsupportedOperationException("This collection is read only");
-            }
-        }
-
-    }
-
-
-    public static class ManagedList extends ManagedCollection implements List, RandomAccess {
-
-        public ManagedList(boolean references, DynamicCollection<ServiceDispatcher> dispatchers) {
-            super(references, dispatchers);
-        }
-
         public Object get(int index) {
             return references ? dispatchers.get(index).reference : dispatchers.get(index).proxy;
         }
@@ -530,12 +472,5 @@
 
     }
 
-    public static class ManagedSet extends ManagedCollection implements Set {
-
-        public ManagedSet(boolean references, DynamicCollection<ServiceDispatcher> dispatchers) {
-            super(references, dispatchers);
-        }
-        
-    }
 
 }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/AbstractPropertyPlaceholder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/AbstractPropertyPlaceholder.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/AbstractPropertyPlaceholder.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/AbstractPropertyPlaceholder.java Fri Jun  5 18:50:20 2009
@@ -33,10 +33,9 @@
 import org.apache.geronimo.blueprint.mutable.MutableMapEntry;
 import org.apache.geronimo.blueprint.mutable.MutableMapMetadata;
 import org.apache.geronimo.blueprint.mutable.MutablePropsMetadata;
-import org.apache.geronimo.blueprint.mutable.MutableRefCollectionMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableRefListMetadata;
 import org.apache.geronimo.blueprint.mutable.MutableRegistrationListener;
 import org.apache.geronimo.blueprint.mutable.MutableServiceMetadata;
-import org.apache.geronimo.blueprint.mutable.MutableValueMetadata;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.reflect.BeanArgument;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
@@ -48,7 +47,7 @@
 import org.osgi.service.blueprint.reflect.Metadata;
 import org.osgi.service.blueprint.reflect.NonNullMetadata;
 import org.osgi.service.blueprint.reflect.PropsMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 import org.osgi.service.blueprint.reflect.RegistrationListener;
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -92,8 +91,8 @@
     protected Metadata processMetadata(Metadata metadata) {
         if (metadata instanceof BeanMetadata) {
             return processBeanMetadata((BeanMetadata) metadata);
-        } else if (metadata instanceof RefCollectionMetadata) {
-            return processRefCollectionMetadata((RefCollectionMetadata) metadata);
+        } else if (metadata instanceof RefListMetadata) {
+            return processRefCollectionMetadata((RefListMetadata) metadata);
         } else if (metadata instanceof ReferenceMetadata) {
             return processReferenceMetadata((ReferenceMetadata) metadata);
         } else if (metadata instanceof ServiceMetadata) {
@@ -144,11 +143,10 @@
         return component;
     }
 
-    protected Metadata processRefCollectionMetadata(RefCollectionMetadata component) {
+    protected Metadata processRefCollectionMetadata(RefListMetadata component) {
         for (Listener listener : component.getServiceListeners()) {
             ((MutableListener) listener).setListenerComponent((Target) processMetadata(listener.getListenerComponent()));
         }
-        ((MutableRefCollectionMetadata) component).setComparator((Target) processMetadata(component.getComparator()));
         return component;
     }
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/ExtNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/ExtNamespaceHandler.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/ExtNamespaceHandler.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/ExtNamespaceHandler.java Fri Jun  5 18:50:20 2009
@@ -39,10 +39,10 @@
 import org.osgi.service.blueprint.reflect.CollectionMetadata;
 import org.osgi.service.blueprint.reflect.BeanProperty;
 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.apache.geronimo.blueprint.ParserContext;
-import org.apache.geronimo.blueprint.ExtendedRefCollectionMetadata;
+import org.apache.geronimo.blueprint.ExtendedRefListMetadata;
 import org.apache.geronimo.blueprint.mutable.MutableBeanMetadata;
 import org.apache.geronimo.blueprint.mutable.MutableComponentMetadata;
 import org.apache.geronimo.blueprint.mutable.MutableValueMetadata;
@@ -150,16 +150,16 @@
         String[] flags = value.trim().split(" ");
         for (String flag : flags) {
             if (PROXY_METHOD_DEFAULT.equals(flag)) {
-                method += ExtendedRefCollectionMetadata.PROXY_METHOD_DEFAULT;
+                method += ExtendedRefListMetadata.PROXY_METHOD_DEFAULT;
             } else if (PROXY_METHOD_CLASSES.equals(flag)) {
-                method += ExtendedRefCollectionMetadata.PROXY_METHOD_CLASSES;
+                method += ExtendedRefListMetadata.PROXY_METHOD_CLASSES;
             } else if (PROXY_METHOD_GREEDY.equals(flag)) {
-                method += ExtendedRefCollectionMetadata.PROXY_METHOD_GREEDY;
+                method += ExtendedRefListMetadata.PROXY_METHOD_GREEDY;
             } else {
                 throw new ComponentDefinitionException("Unknown proxy method: " + flag);
             }
         }
-        if ((method & ExtendedRefCollectionMetadata.PROXY_METHOD_GREEDY) != 0 && !(component instanceof RefCollectionMetadata)) {
+        if ((method & ExtendedRefListMetadata.PROXY_METHOD_GREEDY) != 0 && !(component instanceof RefListMetadata)) {
             throw new ComponentDefinitionException("Greedy proxying is only available for <ref-list> and <ref-set> elements");
         }
         ((MutableServiceReferenceMetadata) component).setProxyMethod(method);

Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefListMetadata.java (from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefCollectionMetadata.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefListMetadata.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefListMetadata.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefCollectionMetadata.java&r1=781861&r2=782099&rev=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefCollectionMetadata.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/mutable/MutableRefListMetadata.java Fri Jun  5 18:50:20 2009
@@ -18,9 +18,8 @@
  */
 package org.apache.geronimo.blueprint.mutable;
 
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
 import org.osgi.service.blueprint.reflect.Target;
-import org.apache.geronimo.blueprint.ExtendedRefCollectionMetadata;
+import org.apache.geronimo.blueprint.ExtendedRefListMetadata;
 
 /**
  * A mutable version of the <code>RefCollectionMetadata</code> that allows modifications.
@@ -28,13 +27,7 @@
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 766508 $, $Date: 2009-04-19 22:09:27 +0200 (Sun, 19 Apr 2009) $
  */
-public interface MutableRefCollectionMetadata extends ExtendedRefCollectionMetadata, MutableServiceReferenceMetadata {
-
-    void setCollectionType(Class collectionType);
-
-    void setComparator(Target comparator);
-
-    void setOrderingBasis(int orderingBasis);
+public interface MutableRefListMetadata extends ExtendedRefListMetadata, MutableServiceReferenceMetadata {
 
     void setMemberType(int memberType);
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java Fri Jun  5 18:50:20 2009
@@ -24,7 +24,6 @@
 
 import org.osgi.service.blueprint.reflect.BeanArgument;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.BeanProperty;
 import org.osgi.service.blueprint.reflect.CollectionMetadata;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.osgi.service.blueprint.reflect.IdRefMetadata;
@@ -32,7 +31,7 @@
 import org.osgi.service.blueprint.reflect.Metadata;
 import org.osgi.service.blueprint.reflect.NullMetadata;
 import org.osgi.service.blueprint.reflect.PropsMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.reflect.RefMetadata;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -76,8 +75,8 @@
         else if (source instanceof BeanMetadata) {
             return new BeanMetadataImpl((BeanMetadata)source);
         }
-        else if (source instanceof RefCollectionMetadata) {
-            return new RefCollectionMetadataImpl((RefCollectionMetadata)source);
+        else if (source instanceof RefListMetadata) {
+            return new RefListMetadataImpl((RefListMetadata)source);
         }
         else if (source instanceof ServiceMetadata) {
             return new ServiceMetadataImpl((ServiceMetadata)source);
@@ -139,8 +138,8 @@
             return type.cast(new ValueMetadataImpl());
         } else if (BeanMetadata.class.isAssignableFrom(type)) {
             return type.cast(new BeanMetadataImpl());
-        } else if (RefCollectionMetadata.class.isAssignableFrom(type)) {
-            return type.cast(new RefCollectionMetadataImpl());
+        } else if (RefListMetadata.class.isAssignableFrom(type)) {
+            return type.cast(new RefListMetadataImpl());
         } else if (ServiceMetadata.class.isAssignableFrom(type)) {
             return type.cast(new ServiceMetadataImpl());
         } else if (ReferenceMetadata.class.isAssignableFrom(type)) {

Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefListMetadataImpl.java (from r781861, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefListMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefListMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java&r1=781861&r2=782099&rev=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefListMetadataImpl.java Fri Jun  5 18:50:20 2009
@@ -18,8 +18,8 @@
  */
 package org.apache.geronimo.blueprint.reflect;
 
-import org.apache.geronimo.blueprint.mutable.MutableRefCollectionMetadata;
-import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableRefListMetadata;
+import org.osgi.service.blueprint.reflect.RefListMetadata;
 import org.osgi.service.blueprint.reflect.Target;
 
 /**
@@ -28,48 +28,18 @@
  * @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 RefCollectionMetadataImpl extends ServiceReferenceMetadataImpl implements MutableRefCollectionMetadata {
+public class RefListMetadataImpl extends ServiceReferenceMetadataImpl implements MutableRefListMetadata {
 
-    private Class collectionType;
-    private Target comparator;
-    private int orderingBasis;
     private int memberType;
 
-    public RefCollectionMetadataImpl() {
+    public RefListMetadataImpl() {
     }
     
-    public RefCollectionMetadataImpl(RefCollectionMetadata source) {
+    public RefListMetadataImpl(RefListMetadata source) {
         super(source);
-        collectionType = source.getCollectionType();
-        comparator = MetadataUtil.cloneTarget(source.getComparator());
-        orderingBasis = source.getOrderingBasis();
         memberType = source.getMemberType();
     }
 
-    public Class getCollectionType() {
-        return collectionType;
-    }
-
-    public void setCollectionType(Class collectionType) {
-        this.collectionType = collectionType;
-    }
-
-    public Target getComparator() {
-        return comparator;
-    }
-
-    public void setComparator(Target comparator) {
-        this.comparator = comparator;
-    }
-
-    public int getOrderingBasis() {
-        return orderingBasis;
-    }
-
-    public void setOrderingBasis(int orderingComparisonBasis) {
-        this.orderingBasis = orderingComparisonBasis;
-    }
-
     public int getMemberType() {
         return memberType;
     }
@@ -89,9 +59,6 @@
                 ", componentName='" + componentName + '\'' +
                 ", filter='" + filter + '\'' +
                 ", serviceListeners=" + serviceListeners +
-                ", collectionType=" + collectionType +
-                ", comparator=" + comparator +
-                ", orderingBasis=" + orderingBasis +
                 ", memberType=" + memberType +
                 ']';
     }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/DynamicCollection.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/DynamicCollection.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/DynamicCollection.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/DynamicCollection.java Fri Jun  5 18:50:20 2009
@@ -22,8 +22,6 @@
 import java.util.AbstractCollection;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
@@ -40,15 +38,11 @@
  */
 public class DynamicCollection<E> extends AbstractCollection<E> {
 
-    protected final boolean allowDuplicates;
-    protected final Comparator comparator;
     protected final Object lock = new Object();
     protected final List<E> storage;
     protected final List<WeakReference<DynamicIterator>> iterators;
 
-    public DynamicCollection(boolean allowDuplicates, Comparator comparator) {
-        this.allowDuplicates = allowDuplicates;
-        this.comparator = comparator;
+    public DynamicCollection() {
         this.storage = new ArrayList<E>();
         this.iterators = new ArrayList<WeakReference<DynamicIterator>>();
     }
@@ -116,37 +110,11 @@
             throw new NullPointerException();
         }
         synchronized (lock) {
-            if (comparator != null) {
-                if (allowDuplicates) {
-                    int index = Collections.binarySearch(storage, o, comparator);
-                    if (index < 0) {
-                        index = -index - 1;
-                    } else {
-                        index = index + 1;
-                    }
-                    internalAdd(index, o);
-                    return true;
-                } else {
-                    int index = Collections.binarySearch(storage, o, comparator);
-                    if (index < 0) {
-                        internalAdd(-index - 1, o);
-                        return true;
-                    } else {
-                        return false;
-                    }
-                }
+            if (!storage.contains(o)) {
+                internalAdd(storage.size(), o);
+                return true;
             } else {
-                if (allowDuplicates) {
-                    internalAdd(storage.size(), o);
-                    return true;
-                } else {
-                    if (!storage.contains(o)) {
-                        internalAdd(storage.size(), o);
-                        return true;
-                    } else {
-                        return false;
-                    }
-                }
+                return false;
             }
         }
     }

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=782099&r1=782098&r2=782099&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 Fri Jun  5 18:50:20 2009
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!--
     /*
-    * $Revision: 7250 $
+    * $Revision: 7279 $
     *
     * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
     *
@@ -48,7 +48,7 @@
 
           The Tcomponent type is the base type for top-level
           Blueprint components.  The <bean> <reference>, <service>,
-          <ref-set>, and <ref-list> elements are all derived from
+          and <ref-list> elements are all derived from
           the Tcomponent type.  This type defines an id attributre
           that is used create references between different components.
           Component elements can also be inlined within other component
@@ -79,7 +79,7 @@
                   depends-on identifies (by name) other components that this component
                   depends on.  The component only be activated after the
                   depends-on components are successfully activated.  Also, if there
-                  are <reference>, <ref-list>, <ref-set> elements with unstatisfied
+                  are <reference> or <ref-list> elements with unstatisfied
                   manadatory references, then the depends-on relationship will also
                   be used to determine whether this service is registered or
                   unregistered.
@@ -102,7 +102,7 @@
           the file does not need to specify a type converter section.
 
           Following the type converters are the component definitions.
-          Components are <bean>, <service>, <reference>, <ref-set>, and
+          Components are <bean>, <service>, <reference>, and
           <ref-list> elements that identify the bundle components that will
           be managed by the blueprint service.
           ]]>
@@ -118,11 +118,10 @@
             <!-- top-level components -->
             <xsd:choice minOccurs="0" maxOccurs="unbounded">
                 <xsd:element name="service" type="Tservice" />
-                <xsd:element name="ref-list" type="Tref-collection" />
-                <xsd:element name="ref-set" type="Tref-collection" />
+                <xsd:element name="ref-list" type="Tref-list" />
                 <xsd:element name="bean" type="Tbean" />
                 <xsd:element name="reference" type="Treference" />
-                <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
+                <xsd:any namespace="##other" processContents="strict"/>
             </xsd:choice>
         </xsd:sequence>
 
@@ -159,7 +158,7 @@
                 <xsd:documentation>
                   <![CDATA[
                   Specifies the default availability value to be used for
-                  <reference>, <ref-set>, and <ref-list> components.  The
+                  <reference>, and <ref-list> components.  The
                   normal default is "mandatory", and can be changed by individual
                   service reference components.
                   ]]>
@@ -177,7 +176,7 @@
                 </xsd:documentation>
             </xsd:annotation>
         </xsd:attribute>
-        <xsd:anyAttribute namespace="##other" processContents="lax" />
+        <xsd:anyAttribute namespace="##other" processContents="strict" />
     </xsd:complexType>
 
     <xsd:complexType name="Ttype-converters">
@@ -195,7 +194,7 @@
             <xsd:element name="bean" type="Tbean" />
             <xsd:element name="reference" type="Treference" />
             <xsd:element name="ref" type="Tref" />
-            <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:any namespace="##other" processContents="strict"/>
         </xsd:choice>
     </xsd:complexType>
 
@@ -219,7 +218,7 @@
             <xsd:element name="bean" type="Tinlined-bean" />
             <xsd:element name="reference" type="Tinlined-reference" />
             <xsd:element name="ref" type="Tref" />
-            <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:any namespace="##other" processContents="strict"/>
         </xsd:choice>
     </xsd:group>
 
@@ -229,14 +228,13 @@
               <![CDATA[
               allComponents is used in contexts where all component element
               types are value.  The set of component elements contains
-              <bean>, <service>, <reference>, <ref-set>, and <ref-list>.
+              <bean>, <service>, <reference>, and <ref-list>.
               ]]>
             </xsd:documentation>
         </xsd:annotation>
         <xsd:choice>
             <xsd:element name="service" type="Tinlined-service" />
-            <xsd:element name="ref-list" type="Tinlined-ref-collection" />
-            <xsd:element name="ref-set" type="Tinlined-ref-collection" />
+            <xsd:element name="ref-list" type="Tinlined-ref-list" />
             <xsd:group ref="targetComponent" />
         </xsd:choice>
     </xsd:group>
@@ -256,8 +254,7 @@
             <xsd:choice minOccurs="0" maxOccurs="unbounded">
                 <xsd:element name="argument" type="Targument" />
                 <xsd:element name="property" type="Tproperty" />
-                <xsd:any namespace="##other" processContents="strict" minOccurs="0"
-                    maxOccurs="unbounded" />
+                <xsd:any namespace="##other" processContents="strict"/>
             </xsd:choice>
         </xsd:sequence>
     </xsd:group>
@@ -284,7 +281,7 @@
                 <xsd:attribute name="factory-method" type="Tmethod" />
                 <xsd:attribute name="factory-ref" type="Tidref" />
                 <xsd:attribute name="scope" type="Tscope" />
-                <xsd:anyAttribute namespace="##other" processContents="lax" />
+                <xsd:anyAttribute namespace="##other" processContents="strict" />
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>
@@ -311,7 +308,7 @@
                 <xsd:attribute name="factory-method" type="Tmethod" />
                 <xsd:attribute name="factory-ref" type="Tidref" />
                 <xsd:attribute name="scope" fixed="prototype" type="Tscope"/>
-                <xsd:anyAttribute namespace="##other" processContents="lax" />
+                <xsd:anyAttribute namespace="##other" processContents="strict" />
             </xsd:restriction>
         </xsd:complexContent>
     </xsd:complexType>
@@ -339,7 +336,7 @@
         </xsd:annotation>
         <xsd:sequence>
             <xsd:element name="description" type="Tdescription" minOccurs="0" />
-            <xsd:group ref="value" />
+            <xsd:group ref="value" minOccurs="0"/>
         </xsd:sequence>
         <xsd:attribute name="index" type="xsd:nonNegativeInteger" />
         <xsd:attribute name="type" type="Tclass" />
@@ -364,7 +361,7 @@
         </xsd:annotation>
         <xsd:sequence>
             <xsd:element name="description" type="Tdescription" minOccurs="0" />
-            <xsd:group ref="value" />
+            <xsd:group ref="value" minOccurs="0"/>
         </xsd:sequence>
         <xsd:attribute name="name" type="Tmethod" use="required" />
         <xsd:attribute name="ref" type="Tidref" />
@@ -400,7 +397,7 @@
         <xsd:complexContent>
             <xsd:extension base="TserviceReference">
                 <xsd:sequence>
-                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="strict" />
                 </xsd:sequence>
                 <xsd:attribute name="timeout" use="optional" type="Ttimeout" />
             </xsd:extension>
@@ -420,7 +417,7 @@
             <xsd:restriction base="Treference">
                 <xsd:sequence>
                     <xsd:group ref="serviceReferenceElements"/>
-                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="strict" />
                 </xsd:sequence>
                 <xsd:attribute name="id" use="prohibited"/>
                 <xsd:attribute name="depends-on" type="TdependsOn" use="optional"/>
@@ -430,52 +427,28 @@
                 <xsd:attribute name="component-name" type="Tidref" use="optional"/>
                 <xsd:attribute name="availability" type="Tavailability" use="optional"/>
                 <xsd:attribute name="timeout" type="Ttimeout" use="optional"/>
-                <xsd:anyAttribute namespace="##other" processContents="lax" />
+                <xsd:anyAttribute namespace="##other" processContents="strict" />
             </xsd:restriction>
         </xsd:complexContent>
     </xsd:complexType>
 
-    <!-- ref-set, ref-list -->
-    <xsd:complexType name="Tref-collection">
+    <!-- ref-list -->
+    <xsd:complexType name="Tref-list">
         <xsd:annotation>
             <xsd:documentation>
               <![CDATA[
-              The Tref-collection builds in the characteristics of the
-              TserviceReference type to define characteristics of the <ref-set>
-              and <ref-list> elements.  This adds in the characteristics that
-              only apply to collections of references (e.g., sorting).
+              The Tref-list builds in the characteristics of the
+              TserviceReference type to define characteristics of the
+              <ref-list>.  This adds in the characteristics that
+              only apply to collections of references (e.g., memberType).
               ]]>
             </xsd:documentation>
         </xsd:annotation>
         <xsd:complexContent>
             <xsd:extension base="TserviceReference">
                 <xsd:sequence>
-                    <xsd:element name="comparator" type="Tcomparator" minOccurs="0"
-                        maxOccurs="1">
-                        <xsd:annotation>
-                            <xsd:documentation>
-                               <![CDATA[
-                               The <comparator> element defines a comparator instance that will
-                               be used to sort the constructed reference collection.
-                               ]]>
-                            </xsd:documentation>
-                        </xsd:annotation>
-                    </xsd:element>
-                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"
-                        processContents="lax" />
+                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="strict" />
                 </xsd:sequence>
-
-                <xsd:attribute name="comparator-ref" type="Tidref" use="optional">
-                    <xsd:annotation>
-                        <xsd:documentation>
-                          <![CDATA[
-                          A shortcut alternative to using a <comparator> element when the
-                          comparator target is a top-level <bean> or <service> element.
-                          ]]>
-                        </xsd:documentation>
-                    </xsd:annotation>
-                </xsd:attribute>
-
                 <xsd:attribute name="member-type" type="Tservice-use" use="optional">
                     <xsd:annotation>
                         <xsd:documentation>
@@ -489,51 +462,34 @@
                         </xsd:documentation>
                     </xsd:annotation>
                 </xsd:attribute>
-
-                <xsd:attribute name="ordering-basis" type="Tservice-use" use="optional">
-                    <xsd:annotation>
-                        <xsd:documentation>
-                          <![CDATA[
-                          Indicates how collection sorting is handled.  An ordering
-                          basis of "service" indicates sorting is handled using the service
-                          instance.  "service-reference" indicates sorting is accomplished using
-                          the ServiceReference objects for the contained services.  The default
-                          value is an implicit "none", indicating no sorting should be performed.
-                          ]]>
-                        </xsd:documentation>
-                    </xsd:annotation>
-                </xsd:attribute>
-
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>
 
-    <xsd:complexType name="Tinlined-ref-collection">
+    <xsd:complexType name="Tinlined-ref-list">
         <xsd:annotation>
             <xsd:documentation>
               <![CDATA[
-              The Tinlined-ref-collection type is used for inlined (i.e. non top level)
-              <ref-list> and <ref-set> elements.
+              The Tinlined-ref-list type is used for inlined (i.e. non top level)
+              <ref-list> elements.
               ]]>
             </xsd:documentation>
         </xsd:annotation>
         <xsd:complexContent>
-            <xsd:restriction base="Tref-collection">
+            <xsd:restriction base="Tref-list">
                 <xsd:sequence>
                     <xsd:group ref="serviceReferenceElements"/>
-                    <xsd:element name="comparator" type="Tcomparator" minOccurs="0" maxOccurs="1"/>
-                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
+                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="strict" />
                 </xsd:sequence>
                 <xsd:attribute name="id" use="prohibited"/>
+                <xsd:attribute name="depends-on" type="TdependsOn" use="optional"/>
+                <xsd:attribute name="initialization" use="prohibited"/>
                 <xsd:attribute name="interface" type="Tclass" use="optional"/>
                 <xsd:attribute name="filter" type="xsd:normalizedString" use="optional"/>
                 <xsd:attribute name="component-name" type="Tidref" use="optional"/>
                 <xsd:attribute name="availability" type="Tavailability" use="optional"/>
-                <xsd:attribute name="comparator-ref" type="Tidref" use="optional"/>
                 <xsd:attribute name="member-type" use="optional" type="Tservice-use"/>
-                <xsd:attribute name="ordering-basis" use="optional" type="Tservice-use"/>
-                <xsd:attribute name="depends-on" type="TdependsOn" use="optional"/>
-                <xsd:anyAttribute namespace="##other" processContents="lax" />
+                <xsd:anyAttribute namespace="##other" processContents="strict" />
             </xsd:restriction>
         </xsd:complexContent>
     </xsd:complexType>
@@ -543,8 +499,8 @@
         <xsd:annotation>
             <xsd:documentation>
               <![CDATA[
-              TserviceReference is the base element type used for <reference>,
-              <ref-set>, and <ref-list> elements.  This type defines all of the
+              TserviceReference is the base element type used for <reference>
+              and <ref-list> elements.  This type defines all of the
               characteristics common to both sorts of references.
               ]]>
             </xsd:documentation>
@@ -592,7 +548,7 @@
                         </xsd:documentation>
                     </xsd:annotation>
                 </xsd:attribute>
-                <xsd:anyAttribute namespace="##other" processContents="lax" />
+                <xsd:anyAttribute namespace="##other" processContents="strict" />
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>
@@ -634,14 +590,16 @@
             <xsd:documentation>
               <![CDATA[
               TReferenceListener defines a reference listener that is attached
-              to a <reference>, <ref-set>, or <ref-list> element.  The listener
+              to a <reference> or <ref-list> element.  The listener
               object can be specified as a <ref> or as an inline <bean> or
               <reference> component.  Listener events are mapped to the indicated
               bind or unbind methods.
               ]]>
             </xsd:documentation>
         </xsd:annotation>
-        <xsd:group ref="targetComponent" />
+        <xsd:sequence>
+            <xsd:group ref="targetComponent" minOccurs="0"/>
+        </xsd:sequence>
         <xsd:attribute name="ref" type="xsd:NMTOKEN" use="optional" />
         <xsd:attribute name="bind-method" type="Tmethod" use="optional" />
         <xsd:attribute name="unbind-method" type="Tmethod" use="optional" />
@@ -669,7 +627,7 @@
               <![CDATA[
               Tavailability defines an availability attribute type.  This is used in this
               schema by the <blueprint> default-availability attribute and the
-              <reference>, <ref-set>, and <ref-list> availability attribute.
+              <reference> and <ref-list> availability attribute.
               ]]>
             </xsd:documentation>
         </xsd:annotation>
@@ -694,11 +652,6 @@
         </xsd:restriction>
     </xsd:simpleType>
 
-    <xsd:complexType name="Tcomparator">
-        <xsd:group ref="targetComponent" />
-        <xsd:attribute name="ref" type="Tidref" />
-    </xsd:complexType>
-
     <!-- service -->
 
     <xsd:complexType name="Tservice">
@@ -715,8 +668,6 @@
             <xsd:extension base="Tcomponent">
                 <xsd:sequence>
                     <xsd:group ref="serviceElements" />
-                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"
-                        processContents="lax" />
                 </xsd:sequence>
                 <xsd:attribute name="interface" type="Tclass" use="optional" />
                 <xsd:attribute name="ref" type="Tidref" use="optional" />
@@ -731,7 +682,7 @@
                         </xsd:documentation>
                     </xsd:annotation>
                 </xsd:attribute>
-                <xsd:anyAttribute namespace="##other" processContents="lax" />
+                <xsd:anyAttribute namespace="##other" processContents="strict" />
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>
@@ -749,7 +700,6 @@
             <xsd:restriction base="Tservice">
                 <xsd:sequence>
                     <xsd:group ref="serviceElements" />
-                    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
                 </xsd:sequence>
                 <xsd:attribute name="id" use="prohibited"/>
                 <xsd:attribute name="depends-on" type="TdependsOn" use="optional"/>
@@ -758,21 +708,12 @@
                 <xsd:attribute name="ref" type="Tidref" 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:anyAttribute namespace="##other" processContents="strict" />
             </xsd:restriction>
         </xsd:complexContent>
     </xsd:complexType>
 
-    <xsd:group name="serviceElements">
-        <xsd:annotation>
-            <xsd:documentation>
-              <![CDATA[
-              A set of service elements that is shared by the <service> element
-              in this schema and the <managed-service-factory> element in the
-              blueprint-cm schema.
-              ]]>
-            </xsd:documentation>
-        </xsd:annotation>
+    <xsd:group name="baseServiceElements">
         <xsd:sequence>
             <xsd:element name="description" type="Tdescription" minOccurs="0" />
             <xsd:element name="interfaces" type="Tinterfaces" minOccurs="0">
@@ -813,18 +754,31 @@
                     </xsd:documentation>
                 </xsd:annotation>
             </xsd:element>
-            <xsd:choice minOccurs="0" maxOccurs="1">
+       </xsd:sequence>
+   </xsd:group>
+
+    <xsd:group name="serviceElements">
+        <xsd:annotation>
+            <xsd:documentation>
+              <![CDATA[
+              A set of service elements that is shared by the <service> element
+              in this schema and the <managed-service-factory> element in the
+              blueprint-cm schema.
+              ]]>
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="baseServiceElements"/>
+            <xsd:group ref="targetComponent" minOccurs="0">
                 <xsd:annotation>
                     <xsd:documentation>
                       <![CDATA[
-                      These are the two types of elements that can be bound as a service.
-                      This will be either a <ref> to a <bean> component or an inline <bean> component.
+                      A service definition can use any of the target types as an inline element
+                      as well.
                       ]]>
                     </xsd:documentation>
                 </xsd:annotation>
-                <xsd:element name="bean" type="Tinlined-bean" />
-                <xsd:element name="ref" type="Tref" />
-            </xsd:choice>
+            </xsd:group>
         </xsd:sequence>
     </xsd:group>
 
@@ -844,7 +798,9 @@
               ]]>
             </xsd:documentation>
         </xsd:annotation>
-        <xsd:group ref="targetComponent" />
+        <xsd:sequence>
+            <xsd:group ref="targetComponent" minOccurs="0"/>
+        </xsd:sequence>
         <xsd:attribute name="ref" type="Tidref" use="optional" />
         <!--  ### why are there both required? -->
         <xsd:attribute name="registration-method" type="Tmethod" use="optional" />
@@ -882,7 +838,6 @@
               ]]>
             </xsd:documentation>
         </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded" />
     </xsd:complexType>
 
     <xsd:group name="nonNullValue">
@@ -899,18 +854,16 @@
               ]]>
             </xsd:documentation>
         </xsd:annotation>
-        <xsd:sequence>
-            <xsd:group ref="allComponents" />
-            <xsd:choice minOccurs="0" maxOccurs="1">
-                <xsd:element name="idref" type="Tref" />
-                <xsd:element name="value" type="Tvalue" />
-                <xsd:element name="list" type="Tcollection" />
-                <xsd:element name="set" type="Tcollection" />
-                <xsd:element name="map" type="Tmap" />
-                <xsd:element name="array" type="Tcollection" />
-                <xsd:element name="props" type="Tprops" />
-            </xsd:choice>
-        </xsd:sequence>
+        <xsd:choice>
+            <xsd:group ref="allComponents"/>
+            <xsd:element name="idref" type="Tref" />
+            <xsd:element name="value" type="Tvalue" />
+            <xsd:element name="list" type="Tcollection" />
+            <xsd:element name="set" type="Tcollection" />
+            <xsd:element name="map" type="Tmap" />
+            <xsd:element name="array" type="Tcollection" />
+            <xsd:element name="props" type="Tprops" />
+        </xsd:choice>
     </xsd:group>
 
     <xsd:complexType name="Tref">
@@ -1037,7 +990,7 @@
         </xsd:annotation>
         <xsd:sequence>
             <xsd:element name="key" type="Tkey" minOccurs="0" />
-            <xsd:group ref="value" />
+            <xsd:group ref="value" minOccurs="0"/>
         </xsd:sequence>
         <xsd:attribute name="key" type="TstringValue" />
         <xsd:attribute name="key-ref" type="Tidref" />
@@ -1077,7 +1030,7 @@
             </xsd:documentation>
         </xsd:annotation>
         <xsd:sequence>
-            <xsd:group ref="value" />
+            <xsd:group ref="value" minOccurs="0"/>
         </xsd:sequence>
         <xsd:attribute name="key" type="TstringValue" use="required" />
         <xsd:attribute name="value" type="TstringValue" use="optional" />
@@ -1102,7 +1055,7 @@
             <xsd:documentation>
               <![CDATA[
               The type definition for the <interfaces> element used for <service>,
-              <reference>, <ref-set>, and <ref-list>;
+              <reference> and <ref-list>;
               ]]>
             </xsd:documentation>
         </xsd:annotation>

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/utils/DynamicCollectionTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/utils/DynamicCollectionTest.java?rev=782099&r1=782098&r2=782099&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/utils/DynamicCollectionTest.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/utils/DynamicCollectionTest.java Fri Jun  5 18:50:20 2009
@@ -32,7 +32,7 @@
     protected DynamicCollection<Object> collection;
 
     protected void setUp() {
-        collection = new DynamicCollection<Object>(true, null);
+        collection = new DynamicCollection<Object>();
     }
 
     public void testAddRemove() throws Exception {



Mime
View raw message