cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r468287 - in /incubator/cxf/trunk/jca/src: main/java/org/apache/cxf/jca/cxf/handlers/ test/java/org/apache/cxf/jca/cxf/ test/java/org/apache/cxf/jca/cxf/handlers/
Date Fri, 27 Oct 2006 06:00:12 GMT
Author: ningjiang
Date: Thu Oct 26 23:00:12 2006
New Revision: 468287

URL: http://svn.apache.org/viewvc?view=rev&rev=468287
Log:
update JCA to use BusFactoryHelper to get and set Bus instance

Modified:
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandler.java
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImplTest.java
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionTestBase.java
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java

Modified: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandler.java?view=diff&rev=468287&r1=468286&r2=468287
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandler.java
(original)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandler.java
Thu Oct 26 23:00:12 2006
@@ -23,8 +23,10 @@
 import java.util.logging.Logger;
 
 //import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactoryHelper;
 import org.apache.cxf.jca.cxf.CXFInvocationHandlerData;
 //import org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl;
+import org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl;
 
 /**
  * The object returned to the application
@@ -45,10 +47,10 @@
                                final Object args[]) throws Throwable {
        
         LOG.fine(this + " on " + method);
-//         Object o = getData().getManagedConnection().getManagedConnectionFactory();
-//         ManagedConnectionFactoryImpl mcf = (ManagedConnectionFactoryImpl)o;
-//         //NOTE reset the inited bus to current ,so CXF-rt can play with JCA setup bus
-//         Bus.setCurrent(mcf.getBus());
+        Object o = getData().getManagedConnection().getManagedConnectionFactory();
+        ManagedConnectionFactoryImpl mcf = (ManagedConnectionFactoryImpl)o;
+        //NOTE reset the inited bus to current ,so CXF-rt can play with JCA setup bus
+        BusFactoryHelper.newInstance().setDefaultBus(mcf.getBus());        
         return invokeNext(proxy, method, args);
     }
 }

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImplTest.java?view=diff&rev=468287&r1=468286&r2=468287
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImplTest.java
(original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImplTest.java
Thu Oct 26 23:00:12 2006
@@ -39,7 +39,7 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.cxf.CXFBusFactory;
+import org.apache.cxf.BusFactoryHelper;
 import org.apache.cxf.connector.CXFConnectionFactory;
 import org.apache.hello_world_soap_http.Greeter;
 import org.easymock.classextension.EasyMock;
@@ -193,7 +193,7 @@
 
     
         Subject subj = new Subject();
-        BusFactory bf = new CXFBusFactory();
+        BusFactory bf = BusFactoryHelper.newInstance();
 
         //        Bus bus = Bus.init();
         Bus bus = bf.getDefaultBus();

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionTestBase.java?view=diff&rev=468287&r1=468286&r2=468287
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionTestBase.java
(original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/ManagedConnectionTestBase.java
Thu Oct 26 23:00:12 2006
@@ -32,7 +32,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.cxf.CXFBusFactory;
+import org.apache.cxf.BusFactoryHelper;
 import org.apache.hello_world_soap_http.Greeter;
 import org.easymock.classextension.EasyMock;
 
@@ -77,9 +77,9 @@
 
         cri2 = new CXFConnectionRequestInfo(Greeter.class, wsdl, serviceName2, portName2);
         
-        BusFactory bf = new CXFBusFactory();
+        BusFactory bf = BusFactoryHelper.newInstance();
         mockBus = bf.getDefaultBus();
-        //        mockBus = Bus.init();
+        
         
         EasyMock.reset(factory); 
         

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java?view=diff&rev=468287&r1=468286&r2=468287
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java
(original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java
Thu Oct 26 23:00:12 2006
@@ -23,6 +23,9 @@
 import junit.textui.TestRunner;
 
 //import org.apache.cxf.Bus;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.BusFactoryHelper;
 import org.apache.cxf.jca.cxf.CXFInvocationHandler;
 import org.apache.cxf.jca.cxf.CXFInvocationHandlerData;
 import org.apache.cxf.jca.cxf.CXFManagedConnection;
@@ -53,17 +56,17 @@
     }
 
    
-//     public void testInvokeSetsBusCurrent() throws Throwable {
+    public void testInvokeSetsBusCurrent() throws Throwable {
         
-//         testObject.invoke(target, testMethod, new Object[] {});
+        testObject.invoke(target, testMethod, new Object[] {});
 
-//         BusFactory bf = new CXFBusFactory();
-//         Bus b = bf.getDefaultBus();
+        BusFactory bf = BusFactoryHelper.newInstance();
+        Bus b = bf.getDefaultBus();
        
-//         assertSame("Current Bus has been set and is as expected, val=" + b, b, mockBus);
-//         // set back the JVM current local variable
-//         Bus.setCurrent(null);
-//     }
+        assertSame("Current Bus has been set and is as expected, val=" + b, b, mockBus);
+         // set back the JVM current local variable
+        bf.setDefaultBus(null);
+    }
 
     public static Test suite() {
         return new TestSuite(ProxyInvocationHandlerTest.class);



Mime
View raw message