incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r820636 - in /incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint: container/BlueprintEventDispatcher.java utils/JavaUtils.java
Date Thu, 01 Oct 2009 12:55:43 GMT
Author: rickmcguire
Date: Thu Oct  1 12:55:42 2009
New Revision: 820636

URL: http://svn.apache.org/viewvc?rev=820636&view=rev
Log:
ARIES-10 EventAdmin events not always including the bundle and extenderBundle version properties.


Modified:
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/JavaUtils.java

Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java?rev=820636&r1=820635&r2=820636&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
Thu Oct  1 12:55:42 2009
@@ -142,14 +142,14 @@
             }
         }
     }
-    
+
     protected void contextDestroyed(Bundle bundle) {
         states.remove(bundle);
     }
-    
+
     public void destroy() {
         this.executor.shutdown();
-        // wait for the queued tasks to execute        
+        // wait for the queued tasks to execute
         try {
             this.executor.awaitTermination(60, TimeUnit.SECONDS);
         } catch (InterruptedException e) {
@@ -180,17 +180,11 @@
             props.put(EventConstants.BUNDLE, event.getBundle());
             props.put(EventConstants.BUNDLE_SYMBOLICNAME, event.getBundle().getSymbolicName());
             props.put(EventConstants.BUNDLE_ID, event.getBundle().getBundleId());
-            Version version = JavaUtils.getBundleVersion(event.getBundle());
-            if (version != null) {
-                props.put(EventConstants.BUNDLE_VERSION, version);
-            }
+            props.put(EventConstants.BUNDLE_VERSION, JavaUtils.getBundleVersion(event.getBundle()));
             props.put(EventConstants.EXTENDER_BUNDLE, event.getExtenderBundle());
             props.put(EventConstants.EXTENDER_BUNDLE_ID, event.getExtenderBundle().getBundleId());
             props.put(EventConstants.EXTENDER_BUNDLE_SYMBOLICNAME, event.getExtenderBundle().getSymbolicName());
-            version = JavaUtils.getBundleVersion(event.getExtenderBundle());
-            if (version != null) {
-                props.put(EventConstants.EXTENDER_BUNDLE_VERSION, version);
-            }
+            props.put(EventConstants.EXTENDER_BUNDLE_VERSION, JavaUtils.getBundleVersion(event.getExtenderBundle()));
 
             if (event.getCause() != null) {
                 props.put(EventConstants.CAUSE, event.getCause());

Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/JavaUtils.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/JavaUtils.java?rev=820636&r1=820635&r2=820636&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/JavaUtils.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/JavaUtils.java
Thu Oct  1 12:55:42 2009
@@ -29,7 +29,7 @@
  * @version $Rev$ $Date$
  */
 public final class JavaUtils {
-    
+
     private JavaUtils() {
     }
 
@@ -41,7 +41,7 @@
             destination.put(key, value);
         }
     }
-    
+
     public static Hashtable getProperties(ServiceReference ref) {
         Hashtable props = new Hashtable();
         for (String key : ref.getPropertyKeys()) {
@@ -49,11 +49,11 @@
         }
         return props;
     }
-    
+
     public static Version getBundleVersion(Bundle bundle) {
         Dictionary headers = bundle.getHeaders();
         String version = (String)headers.get(Constants.BUNDLE_VERSION);
-        return (version != null) ? Version.parseVersion(version) : null;
+        return (version != null) ? Version.parseVersion(version) : Version.emptyVersion;
     }
-    
+
 }



Mime
View raw message