geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r772006 - in /geronimo/sandbox/blueprint: blueprint-cm/src/main/resources/OSGI-INF/blueprint/cm.xml blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/NamespaceHandlerRegistryImpl.java
Date Tue, 05 May 2009 23:11:19 GMT
Author: gawor
Date: Tue May  5 23:11:18 2009
New Revision: 772006

URL: http://svn.apache.org/viewvc?rev=772006&view=rev
Log:
fix property name for namespace handlers

Modified:
    geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/cm.xml
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/NamespaceHandlerRegistryImpl.java

Modified: geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/cm.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/cm.xml?rev=772006&r1=772005&r2=772006&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/cm.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/cm.xml Tue
May  5 23:11:18 2009
@@ -3,7 +3,7 @@
 
     <service interface="org.osgi.service.blueprint.namespace.NamespaceHandler">
         <service-properties>
-            <entry key="org.osgi.blueprint.namespace" value="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"/>
+            <entry key="osgi.service.blueprint.namespace" value="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"/>
         </service-properties>
         <bean class="org.apache.geronimo.blueprint.compendium.cm.CmNamespaceHandler"/>
     </service>

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/NamespaceHandlerRegistryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/NamespaceHandlerRegistryImpl.java?rev=772006&r1=772005&r2=772006&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/NamespaceHandlerRegistryImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/NamespaceHandlerRegistryImpl.java
Tue May  5 23:11:18 2009
@@ -46,8 +46,8 @@
  * @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
  */
 public class NamespaceHandlerRegistryImpl implements NamespaceHandlerRegistry, ServiceTrackerCustomizer
{
-
-    public static final String NAMESPACE = "org.osgi.blueprint.namespace";
+    
+    public static final String NAMESPACE = "osgi.service.blueprint.namespace";
 
     private static final Logger LOGGER = LoggerFactory.getLogger(NamespaceHandlerRegistryImpl.class);
 
@@ -154,13 +154,14 @@
             Collection col = (Collection) ns;
             List<URI> namespaces = new ArrayList<URI>(col.size());
             for (Object o : col) {
-                if (o instanceof URI) {
-                    namespaces.add((URI) o);
-                } else if (o instanceof String) {
-                    namespaces.add(URI.create((String) o));
-                } else {
-                    throw new IllegalArgumentException("NamespaceHandler service has an associated
" + NAMESPACE + " property defined which can not be converted to an array of URI");
-                }
+                namespaces.add(toURI(o));
+            }
+            return namespaces;
+        } else if (ns instanceof Object[]) {
+            Object[] array = (Object[]) ns;
+            List<URI> namespaces = new ArrayList<URI>(array.length);
+            for (Object o : array) {
+                namespaces.add(toURI(o));
             }
             return namespaces;
         } else {
@@ -168,6 +169,16 @@
         }
     }
 
+    private static URI toURI(Object o) {
+        if (o instanceof URI) {
+            return (URI) o;
+        } else if (o instanceof String) {
+            return URI.create((String) o);
+        } else {
+            throw new IllegalArgumentException("NamespaceHandler service has an associated
" + NAMESPACE + " property defined which can not be converted to an array of URI");
+        }
+    }
+    
     public synchronized NamespaceHandler getNamespaceHandler(URI uri) {
         return handlers.get(uri);
     }



Mime
View raw message