cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1298637 - in /cxf/branches/2.5.x-fixes: ./ rt/management/src/main/java/org/apache/cxf/management/jmx/ rt/management/src/test/java/org/apache/cxf/management/ rt/management/src/test/resources/
Date Thu, 08 Mar 2012 22:49:43 GMT
Author: ay
Date: Thu Mar  8 22:49:43 2012
New Revision: 1298637

URL: http://svn.apache.org/viewvc?rev=1298637&view=rev
Log:
Merged revisions 1298601,1298608,1298624 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1298601 | ay | 2012-03-08 22:46:32 +0100 (Thu, 08 Mar 2012) | 1 line
  
  [CXF-4170] JMX InstrumentationManagerImpl's properties may not be read correctly in standalone
mode after 2.5.2
........
  r1298608 | ay | 2012-03-08 23:03:27 +0100 (Thu, 08 Mar 2012) | 1 line
  
  something went wrong with CXF-4170 fix; temporarily reverting it
........
  r1298624 | ay | 2012-03-08 23:26:04 +0100 (Thu, 08 Mar 2012) | 1 line
  
  un-reverting the previous commit for CXF-4170 as it looks okay
........

Added:
    cxf/branches/2.5.x-fixes/rt/management/src/test/resources/managed-spring3.xml
      - copied unchanged from r1298624, cxf/trunk/rt/management/src/test/resources/managed-spring3.xml
Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
    cxf/branches/2.5.x-fixes/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar  8 22:49:43 2012
@@ -1 +1 @@
-/cxf/trunk:1297296
+/cxf/trunk:1297296,1298601-1298624

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

Modified: cxf/branches/2.5.x-fixes/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java?rev=1298637&r1=1298636&r2=1298637&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
Thu Mar  8 22:49:43 2012
@@ -389,17 +389,17 @@ public class InstrumentationManagerImpl 
     
     private void readJMXProperties(Bus b) {
         if (b != null) {
-            persistentBusId = getBusProperty(b, "bus.jmx.persistentBusId", null);
+            persistentBusId = getBusProperty(b, "bus.jmx.persistentBusId", persistentBusId);
             mbeanServerName = 
-                getBusProperty(b, "bus.jmx.serverName", ManagementConstants.DEFAULT_DOMAIN_NAME);
+                getBusProperty(b, "bus.jmx.serverName", mbeanServerName);
             usePlatformMBeanServer = 
-                Boolean.valueOf(getBusProperty(b, "bus.jmx.usePlatformMBeanServer", null));
+                getBusProperty(b, "bus.jmx.usePlatformMBeanServer", usePlatformMBeanServer);
             createMBServerConnectorFactory = 
-                Boolean.valueOf(getBusProperty(b, "bus.jmx.createMBServerConnectorFactory",
null));
-            daemon = Boolean.valueOf(getBusProperty(b, "bus.jmx.daemon", null));
-            threaded = Boolean.valueOf(getBusProperty(b, "bus.jmx.threaded", null));
-            enabled = Boolean.valueOf(getBusProperty(b, "bus.jmx.enabled", null));
-            jmxServiceURL = getBusProperty(b, "bus.jmx.JMXServiceURL", null);
+                getBusProperty(b, "bus.jmx.createMBServerConnectorFactory", createMBServerConnectorFactory);
+            daemon = getBusProperty(b, "bus.jmx.daemon", daemon);
+            threaded = getBusProperty(b, "bus.jmx.threaded", threaded);
+            enabled = getBusProperty(b, "bus.jmx.enabled", enabled);
+            jmxServiceURL = getBusProperty(b, "bus.jmx.JMXServiceURL", jmxServiceURL);
         }
     }
 
@@ -407,5 +407,10 @@ public class InstrumentationManagerImpl 
         String v = (String)b.getProperty(key);
         return v != null ? v : dflt;
     }
+
+    private static boolean getBusProperty(Bus b, String key, boolean dflt) {
+        String v = (String)b.getProperty(key);
+        return v != null ? Boolean.valueOf(v) : dflt;
+    }
 }
 

Modified: cxf/branches/2.5.x-fixes/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java?rev=1298637&r1=1298636&r2=1298637&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
Thu Mar  8 22:49:43 2012
@@ -65,6 +65,16 @@ public class InstrumentationManagerTest 
     }
     
     @Test
+    public void testInstrumentationEnabledSetBeforeBusSet() {
+        SpringBusFactory factory = new SpringBusFactory();
+        bus =  factory.createBus("managed-spring3.xml", true);
+        im = bus.getExtension(InstrumentationManager.class);
+        assertTrue("Instrumentation Manager should not be null", im != null);
+        MBeanServer mbs = im.getMBeanServer();
+        assertNotNull("MBeanServer should be available.", mbs);
+    }
+    
+    @Test
     // try to get WorkQueue information
     public void testWorkQueueInstrumentation() throws Exception {
         SpringBusFactory factory = new SpringBusFactory();



Mime
View raw message