cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r682951 - in /cxf/trunk: distribution/src/main/release/samples/configuration_interceptor/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/main/java/org/apache/cxf/workqueue/ rt/management/src/test/java/org/apache/cxf/management...
Date Tue, 05 Aug 2008 21:21:13 GMT
Author: dkulp
Date: Tue Aug  5 14:21:12 2008
New Revision: 682951

URL: http://svn.apache.org/viewvc?rev=682951&view=rev
Log:
[CXF-1734] Fix mbean names and stuff

Modified:
    cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/pom.xml
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueImplMBeanWrapper.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImplMBeanWrapper.java
    cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java

Modified: cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/pom.xml?rev=682951&r1=682950&r2=682951&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/pom.xml (original)
+++ cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/pom.xml Tue
Aug  5 14:21:12 2008
@@ -76,6 +76,7 @@
                                 <configuration>
                                     <executable>java</executable>
                                     <arguments>
+				        <argument>-Dcxf.config.file=${basedir}/src/demo/stream/server/server.xml</argument>
                                         <argument>-classpath</argument>
                                         <classpath/>
                                         <argument>demo.stream.server.Server</argument>

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java?rev=682951&r1=682950&r2=682951&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java Tue
Aug  5 14:21:12 2008
@@ -43,6 +43,7 @@
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.FileSystemResource;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.UrlResource;
 import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
@@ -137,36 +138,10 @@
             usingDefault = true;
         }
         for (String cfgFile : cfgFiles) {
-            boolean found = false;
-            Resource cpr = new ClassPathResource(cfgFile);
-            if (!cpr.exists()) {
-                try {
-                    //see if it's a URL
-                    URL url = new URL(cfgFile);
-                    cpr = new UrlResource(url);
-                    if (cpr.exists()) {
-                        resources.add(cpr);
-                        found = true;
-                    }
-                } catch (MalformedURLException e) {
-                    //ignore
-                }
-                if (!found) {
-                    //try loading it our way
-                    URL url = ClassLoaderUtils.getResource(cfgFile, this.getClass());
-                    if (url != null) {
-                        cpr = new UrlResource(url);
-                        if (cpr.exists()) {
-                            resources.add(cpr);
-                            found = true;
-                        }
-                    }
-                }
-            } else {
+            Resource cpr = findResource(cfgFile);
+            if (cpr != null && cpr.exists()) {
                 resources.add(cpr);
-                found = true;
-            }
-            if (!found) {
+            } else {
                 if (!usingDefault) {
                     LogUtils.log(LOG, Level.WARNING, "USER_CFG_FILE_NOT_FOUND_MSG", cfgFile);
                 } else {
@@ -212,6 +187,36 @@
         return res;
     }
     
+    protected Resource findResource(String cfgFile) {
+        Resource cpr = new ClassPathResource(cfgFile);
+        if (cpr.exists()) {
+            return cpr;
+        }
+        try {
+            //see if it's a URL
+            URL url = new URL(cfgFile);
+            cpr = new UrlResource(url);
+            if (cpr.exists()) {
+                return cpr;
+            }
+        } catch (MalformedURLException e) {
+            //ignore
+        }
+        //try loading it our way
+        URL url = ClassLoaderUtils.getResource(cfgFile, this.getClass());
+        if (url != null) {
+            cpr = new UrlResource(url);
+            if (cpr.exists()) {
+                return cpr;
+            }
+        }
+        cpr = new FileSystemResource(cfgFile);
+        if (cpr.exists()) {
+            return cpr;
+        }
+        return null;
+    }
+    
     @Override
     protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
         // Spring always creates a new one of these, which takes a fair amount

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueImplMBeanWrapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueImplMBeanWrapper.java?rev=682951&r1=682950&r2=682951&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueImplMBeanWrapper.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueImplMBeanWrapper.java
Tue Aug  5 14:21:12 2008
@@ -27,12 +27,12 @@
 import org.apache.cxf.management.annotation.ManagedAttribute;
 import org.apache.cxf.management.annotation.ManagedResource;
 
-@ManagedResource(componentName = "WorkQueueManager", 
-                 description = "The CXF manangement of work queues", 
+@ManagedResource(componentName = "WorkQueue", 
+                 description = "The CXF work queue", 
                  currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200)
                  
 public class WorkQueueImplMBeanWrapper implements ManagedComponent {    
-    private static final String TYPE_VALUE = "WorkQueueMBean";
+    private static final String TYPE_VALUE = "WorkQueues";
     
     private AutomaticWorkQueueImpl aWorkQueue;
     

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImplMBeanWrapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImplMBeanWrapper.java?rev=682951&r1=682950&r2=682951&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImplMBeanWrapper.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/WorkQueueManagerImplMBeanWrapper.java
Tue Aug  5 14:21:12 2008
@@ -34,7 +34,7 @@
                  
 public class WorkQueueManagerImplMBeanWrapper implements ManagedComponent {    
     static final String NAME_VALUE = "Bus.WorkQueueManager";
-    static final String TYPE_VALUE = "WorkQueueManagerMBean";
+    static final String TYPE_VALUE = "WorkQueueManager";
     
     private WorkQueueManagerImpl wqManager;
     private Bus bus;
@@ -55,10 +55,9 @@
         StringBuffer buffer = new StringBuffer();
         buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME + ":");
         buffer.append(ManagementConstants.BUS_ID_PROP + "=" + busId + ",");
-        buffer.append(ManagementConstants.TYPE_PROP + "=" + TYPE_VALUE + ",");
-        buffer.append(ManagementConstants.NAME_PROP + "=" + NAME_VALUE);
+        buffer.append("WorkQueueManager=" + NAME_VALUE);
+        buffer.append("," + ManagementConstants.TYPE_PROP + "=" + TYPE_VALUE);
 
-       
         //Use default domain name of server
         return new ObjectName(buffer.toString());
     }

Modified: cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java?rev=682951&r1=682950&r2=682951&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
(original)
+++ cxf/trunk/rt/management/src/test/java/org/apache/cxf/management/InstrumentationManagerTest.java
Tue Aug  5 14:21:12 2008
@@ -71,7 +71,7 @@
         MBeanServer mbs = im.getMBeanServer();
         assertNotNull("MBeanServer should be available.", mbs);
         ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME 
-                                         + ":type=WorkQueueMBean,*");
+                                         + ":type=WorkQueues,*");
         Set s = mbs.queryNames(name, null);
         assertTrue(s.size() == 1);
         Iterator it = s.iterator();

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java?rev=682951&r1=682950&r2=682951&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java
Tue Aug  5 14:21:12 2008
@@ -70,7 +70,7 @@
                 
         MBeanServer mbs = im.getMBeanServer();      
         ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME 
-                                         + ":type=WorkQueueManagerMBean,*");
+                                         + ":type=WorkQueueManager,*");
         Set s = mbs.queryNames(name, null);
         StringBuilder b = new StringBuilder();
         for (ObjectName o : CastUtils.cast(s, ObjectName.class)) {
@@ -83,7 +83,7 @@
         manager.getAutomaticWorkQueue();
 
         name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME 
-                             + ":type=WorkQueueMBean,*");
+                             + ":type=WorkQueues,*");
         s = mbs.queryNames(name, null);
         b = new StringBuilder();
         for (ObjectName o : CastUtils.cast(s, ObjectName.class)) {



Mime
View raw message