cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1483985 - in /cxf/trunk: api/src/main/java/org/apache/cxf/ integration/jca/src/test/java/org/apache/cxf/jca/cxf/test/ rt/core/src/main/java/org/apache/cxf/bus/ rt/core/src/main/java/org/apache/cxf/bus/extension/ rt/core/src/main/java/org/a...
Date Fri, 17 May 2013 20:50:40 GMT
Author: dkulp
Date: Fri May 17 20:50:40 2013
New Revision: 1483985

URL: http://svn.apache.org/r1483985
Log:
Start some refactoring around the Bus interface

Removed:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/BusState.java
Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java
    cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java?rev=1483985&r1=1483984&r2=1483985&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/Bus.java Fri May 17 20:50:40 2013
@@ -32,6 +32,9 @@ import org.apache.cxf.interceptor.Interc
  * of the Bus it may also be responsible for wiring up the CXF internals.
  */
 public interface Bus extends InterceptorProvider {
+    public enum BusState {
+        INITIAL, INITIALIZING, RUNNING, SHUTTING_DOWN, SHUTDOWN;
+    }
     
     String DEFAULT_BUS_ID = "cxf";
     
@@ -41,17 +44,17 @@ public interface Bus extends Interceptor
     
     boolean hasExtensionByName(String name);
     
-    
     String getId();
     
     void shutdown(boolean wait);
     
-    void run();
-    
     void setProperty(String s, Object o);
+    
     Object getProperty(String s);
-    Map<String, Object> getProperties();
     
+    Map<String, Object> getProperties();    
     
     Collection<Feature> getFeatures();
+    
+    BusState getState();
 }

Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java?rev=1483985&r1=1483984&r2=1483985&view=diff
==============================================================================
--- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java (original)
+++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/test/DummyBus.java Fri
May 17 20:50:40 2013
@@ -146,4 +146,8 @@ public class DummyBus extends AbstractBa
         return null;
     }
 
+    public BusState getState() {
+        return null;
+    }
+
 }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1483985&r1=1483984&r2=1483985&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Fri May 17 20:50:40
2013
@@ -178,20 +178,6 @@ public class CXFBusImpl extends Abstract
         return null == id ? DEFAULT_BUS_ID + Integer.toString(Math.abs(this.hashCode()))
: id;
     }
 
-    public void run() {
-        synchronized (this) {
-            state = BusState.RUNNING;
-            while (state == BusState.RUNNING) {
-
-                try {
-                    wait();
-                } catch (InterruptedException ex) {
-                    // ignore;
-                }
-            }
-        }
-    }
-
     public void initialize() {
         setState(BusState.INITIALIZING);
         

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java?rev=1483985&r1=1483984&r2=1483985&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
Fri May 17 20:50:40 2013
@@ -23,7 +23,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.cxf.binding.BindingFactoryManager;
-import org.apache.cxf.bus.BusState;
 import org.apache.cxf.bus.CXFBusImpl;
 import org.apache.cxf.bus.managers.BindingFactoryManagerImpl;
 import org.apache.cxf.bus.managers.ConduitInitiatorManagerImpl;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java?rev=1483985&r1=1483984&r2=1483985&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java Fri May 17 20:50:40
2013
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.bus.spring;
 
-import org.apache.cxf.bus.BusState;
 import org.apache.cxf.bus.extension.ExtensionManagerBus;
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.configuration.ConfiguredBeanLocator;

Modified: cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java?rev=1483985&r1=1483984&r2=1483985&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java (original)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java Fri May 17 20:50:40
2013
@@ -100,52 +100,6 @@ public class CXFBusImplTest extends Asse
     }
     
     @Test
-    public void testRun() {
-        final CXFBusImpl bus = new CXFBusImpl();
-        Thread t = new Thread() {
-            public void run() {
-                bus.run();
-            }
-        };
-        t.start();
-        try {
-            Thread.sleep(100);
-        } catch (InterruptedException ex) {
-            // ignore;
-        }
-        try {
-            t.join(400);
-        } catch (InterruptedException ex) {
-            // ignore
-        }
-        assertEquals(BusState.RUNNING, bus.getState());
-    }
-    
-    @Test
-    public void testShutdown() {
-        final CXFBusImpl bus = new CXFBusImpl();
-        Thread t = new Thread() {
-            public void run() {
-                bus.run();
-            }
-        };
-        t.start();
-        try {
-            Thread.sleep(100);
-        } catch (InterruptedException ex) {
-            // ignore;
-        }
-        bus.shutdown(true);
-        try {
-            t.join();
-        } catch (InterruptedException ex) {
-            // ignore
-        }
-        assertEquals(BusState.SHUTDOWN, bus.getState());
-        
-    }
-    
-    @Test
     public void testShutdownWithBusLifecycle() {
         final CXFBusImpl bus = new ExtensionManagerBus();
         BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);



Mime
View raw message