cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1166399 - in /cxf/branches/2.4.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/bus/ rt/core/src/main/java/org/apache/cxf/bus/blueprint/ rt/core/src/main/java/org/apache/cxf/bus/spring/
Date Wed, 07 Sep 2011 21:07:57 GMT
Author: dkulp
Date: Wed Sep  7 21:07:57 2011
New Revision: 1166399

URL: http://svn.apache.org/viewvc?rev=1166399&view=rev
Log:
Merged revisions 1166398 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1166398 | dkulp | 2011-09-07 16:56:01 -0400 (Wed, 07 Sep 2011) | 2 lines
  
  When running in OSGi, use the bundle name as part of the bus id for
  purpose of management.
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1166399&r1=1166398&r2=1166399&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Wed
Sep  7 21:07:57 2011
@@ -53,7 +53,7 @@ public class CXFBusImpl extends Abstract
     }
     
     protected final Map<Class, Object> extensions;
-    private String id;
+    protected String id;
     private BusState state;      
     private Collection<AbstractFeature> features;
     private Map<String, Object> properties = new ConcurrentHashMap<String, Object>();

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java?rev=1166399&r1=1166398&r2=1166399&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java
Wed Sep  7 21:07:57 2011
@@ -53,5 +53,12 @@ public class BlueprintBus extends Extens
         setExtension(new BlueprintBeanLocator(getExtension(ConfiguredBeanLocator.class),
container, context),
                            ConfiguredBeanLocator.class);
     }
-    
+    public String getId() {
+        if (id == null) {
+            id = context.getBundle().getSymbolicName() + "-" 
+                + DEFAULT_BUS_ID + Integer.toString(this.hashCode());
+        }
+        return id;
+    }
+
 }

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java?rev=1166399&r1=1166398&r2=1166399&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
Wed Sep  7 21:07:57 2011
@@ -64,10 +64,6 @@ public class BusDefinitionParser extends
         if (!StringUtils.isEmpty(id)) {
             bean.addPropertyValue("id", id);
         }
-        //element.removeAttribute("bus");
-        //element.removeAttribute("name");
-        //element.removeAttribute("id");
-        
 
         bean.addConstructorArgValue(bus);
         bean.setLazyInit(false);

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java?rev=1166399&r1=1166398&r2=1166399&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
Wed Sep  7 21:07:57 2011
@@ -100,5 +100,20 @@ public class SpringBus extends Extension
         ctx.close();
         super.destroyBeans();
     }
+    
+    public String getId() {
+        if (id == null) {
+            try {
+                Class<?> cls = Class.forName("org.osgi.framework.BundleContext");
+                Object o = getExtension(cls);
+                Object o2 = o.getClass().getMethod("getBundle").invoke(o);
+                String s = (String)o2.getClass().getMethod("getSymbolicName").invoke(o2);
+                id = s + "-" + DEFAULT_BUS_ID + Integer.toString(this.hashCode());
+            } catch (Throwable t) {
+                id = super.getId();
+            }
+        }
+        return id;
+    }
 
 }



Mime
View raw message