incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r897884 - /incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java
Date Mon, 11 Jan 2010 14:48:57 GMT
Author: ozzy
Date: Mon Jan 11 14:48:57 2010
New Revision: 897884

URL: http://svn.apache.org/viewvc?rev=897884&view=rev
Log:
ARIES-112 Test if handler is non-null before adding to registry

Modified:
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java

Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java?rev=897884&r1=897883&r2=897884&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java
Mon Jan 11 14:48:57 2010
@@ -86,15 +86,20 @@
     }
 
     public Object addingService(ServiceReference reference) {
+        LOGGER.debug("Adding NamespaceHandler "+reference.toString());
         NamespaceHandler handler = (NamespaceHandler) bundleContext.getService(reference);
-        try {
-            Map<String, Object> props = new HashMap<String, Object>();
-            for (String name : reference.getPropertyKeys()) {
-                props.put(name, reference.getProperty(name));
+        if(handler!=null){
+            try {
+                Map<String, Object> props = new HashMap<String, Object>();
+                for (String name : reference.getPropertyKeys()) {
+                    props.put(name, reference.getProperty(name));
+                }
+                registerHandler(handler, props);
+            } catch (Exception e) {
+                LOGGER.warn("Error registering NamespaceHandler", e);
             }
-            registerHandler(handler, props);
-        } catch (Exception e) {
-            LOGGER.warn("Error registering NamespaceHandler", e);
+        }else{
+            LOGGER.warn("Error resolving NamespaceHandler, null Service obtained from tracked
ServiceReference {} for bundle {}, ver {}", new Object[]{reference.toString(), reference.getBundle().getSymbolicName(),
reference.getBundle().getVersion()});
         }
         return handler;
     }



Mime
View raw message