cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r811477 - in /cxf/branches/2.2.x-fixes: ./ integration/jca/src/main/java/org/apache/cxf/jca/outbound/ integration/jca/src/test/java/org/apache/cxf/jca/outbound/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/
Date Fri, 04 Sep 2009 16:36:41 GMT
Author: dkulp
Date: Fri Sep  4 16:36:37 2009
New Revision: 811477

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

........
  r811467 | dkulp | 2009-09-04 12:19:57 -0400 (Fri, 04 Sep 2009) | 2 lines
  
  [CXF-2398] Patch from Seumas applied to fix issues of closing the JCA
  proxies.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/integration/jca/src/main/java/org/apache/cxf/jca/outbound/ManagedConnectionImpl.java
    cxf/branches/2.2.x-fixes/integration/jca/src/test/java/org/apache/cxf/jca/outbound/ManagedConnectionImplTest.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  4 16:36:37 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192,797194,797231-797233,797442,797505,797517,797534,797581-797583,797587,797640,797651,797699,797882-797883,798344-798346,798363,798461,798479,798533,798551,798557,798561-798562,798570,798573,79858
 4,798654,798748-798749,798816,798891,798929-798930,799245,799267,799439,799448,799637,799723-799724,799792,800453,800497-800498,801380-801381,801447,801962,802892,803056,803129,803174,803419,803460,803493,803689,804002,804175,804276,805784,805907,805909,806020-806021,806023,806405-806406,806576,806602-806604,806620,806627,806631,806633,806638,806687,806876,806922,806979-806982,807181,807205,807295,807748,807807,808035,808069,808085,808107,808464,808488,808731,808885,808925,809082-809083,809162,809190,809417-809626,809631,809663,809706,809738,809962,810090,810143,810349,810376,810513,810526,810927,811013,811148-811149,811175,811183,811387
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192,797194,797231-797233,797442,797505,797517,797534,797581-797583,797587,797640,797651,797699,797882-797883,798344-798346,798363,798461,798479,798533,798551,798557,798561-798562,798570,798573,79858
 4,798654,798748-798749,798816,798891,798929-798930,799245,799267,799439,799448,799637,799723-799724,799792,800453,800497-800498,801380-801381,801447,801962,802892,803056,803129,803174,803419,803460,803493,803689,804002,804175,804276,805784,805907,805909,806020-806021,806023,806405-806406,806576,806602-806604,806620,806627,806631,806633,806638,806687,806876,806922,806979-806982,807181,807205,807295,807748,807807,808035,808069,808085,808107,808464,808488,808731,808885,808925,809082-809083,809162,809190,809417-809626,809631,809663,809706,809738,809962,810090,810143,810349,810376,810513,810526,810927,811013,811148-811149,811175,811183,811387,811467

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

Modified: cxf/branches/2.2.x-fixes/integration/jca/src/main/java/org/apache/cxf/jca/outbound/ManagedConnectionImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/integration/jca/src/main/java/org/apache/cxf/jca/outbound/ManagedConnectionImpl.java?rev=811477&r1=811476&r2=811477&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/integration/jca/src/main/java/org/apache/cxf/jca/outbound/ManagedConnectionImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/integration/jca/src/main/java/org/apache/cxf/jca/outbound/ManagedConnectionImpl.java
Fri Sep  4 16:36:37 2009
@@ -77,6 +77,7 @@
     private boolean isClosed;
     private Bus bus;
     private Object associatedHandle;
+    private Object clientProxy;
     
     public ManagedConnectionImpl(ManagedConnectionFactoryImpl mcf,
             ConnectionRequestInfo connReqInfo, Subject subject) {
@@ -115,6 +116,10 @@
         if (LOG.isLoggable(Level.FINER)) {
             LOG.finer("destroy");
         }
+        
+        Client client = ClientProxy.getClient(clientProxy);
+        client.destroy();
+
         handles.clear();
         isClosed = false;
         bus = null;
@@ -245,31 +250,33 @@
                         createClientProxy(spec), spec));
     }
     
-    private Object createClientProxy(final CXFConnectionSpec spec) {
-        
-        validateConnectionSpec(spec);
-        ClientProxyFactoryBean factory = null;
-
-        if (EndpointUtils.hasWebServiceAnnotation(spec.getServiceClass())) {
-            factory = new JaxWsProxyFactoryBean();
-        } else {
-            factory = new ClientProxyFactoryBean();
-        }
-              
-        factory.setBus(getBus(spec.getBusConfigURL()));
-        factory.setServiceClass(spec.getServiceClass());
-        factory.getServiceFactory().setEndpointName(spec.getEndpointName());
-        factory.getServiceFactory().setServiceName(spec.getServiceName());
-        factory.getServiceFactory().setWsdlURL(spec.getWsdlURL());
-
-        if (spec.getAddress() != null) {
-            factory.setAddress(spec.getAddress());
+    private synchronized Object createClientProxy(final CXFConnectionSpec spec) {
+        if (clientProxy == null) {
+            validateConnectionSpec(spec);
+            ClientProxyFactoryBean factory = null;
+            
+            if (EndpointUtils.hasWebServiceAnnotation(spec.getServiceClass())) {
+                factory = new JaxWsProxyFactoryBean();
+            } else {
+                factory = new ClientProxyFactoryBean();
+            }
+            
+            factory.setBus(getBus(spec.getBusConfigURL()));
+            factory.setServiceClass(spec.getServiceClass());
+            factory.getServiceFactory().setEndpointName(spec.getEndpointName());
+            factory.getServiceFactory().setServiceName(spec.getServiceName());
+            factory.getServiceFactory().setWsdlURL(spec.getWsdlURL());
+            
+            if (spec.getAddress() != null) {
+                factory.setAddress(spec.getAddress());
+            }
+            
+            configureObject(spec.getEndpointName().toString() + ".jaxws-client.proxyFactory",
factory);
+            
+            clientProxy = factory.create();
         }
-        
-        configureObject(spec.getEndpointName().toString() + ".jaxws-client.proxyFactory",
factory);
-
-        return factory.create();
 
+        return clientProxy;
     }
 
     private void validateConnectionSpec(CXFConnectionSpec spec) {
@@ -405,11 +412,6 @@
             event.setConnectionHandle(proxy);
             sendEvent(event);
             
-            ConnectionInvocationHandler ch = 
-                (ConnectionInvocationHandler)Proxy.getInvocationHandler(proxy);         
  
-            Client client = ClientProxy.getClient(ch.target);
-            client.destroy();
-            
             return null;
         }
     }

Modified: cxf/branches/2.2.x-fixes/integration/jca/src/test/java/org/apache/cxf/jca/outbound/ManagedConnectionImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/integration/jca/src/test/java/org/apache/cxf/jca/outbound/ManagedConnectionImplTest.java?rev=811477&r1=811476&r2=811477&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/integration/jca/src/test/java/org/apache/cxf/jca/outbound/ManagedConnectionImplTest.java
(original)
+++ cxf/branches/2.2.x-fixes/integration/jca/src/test/java/org/apache/cxf/jca/outbound/ManagedConnectionImplTest.java
Fri Sep  4 16:36:37 2009
@@ -21,6 +21,7 @@
 import javax.security.auth.Subject;
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.BusFactory;
 import org.apache.hello_world_soap_http.Greeter;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -39,6 +40,8 @@
      */
     @Test
     public void testHandleEqualsMethod() throws Exception {
+        BusFactory.setDefaultBus(null);
+        
         IMocksControl control = EasyMock.createNiceControl();
 
         ManagedConnectionFactoryImpl mcf = control.createMock(ManagedConnectionFactoryImpl.class);

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=811477&r1=811476&r2=811477&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
Fri Sep  4 16:36:37 2009
@@ -32,7 +32,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.MessageListener;
@@ -50,7 +49,6 @@
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.AbstractConduit;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.springframework.jms.connection.SingleConnectionFactory;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.MessageCreator;
 import org.springframework.jms.listener.AbstractMessageListenerContainer;
@@ -313,7 +311,7 @@
         }
     }
 
-    public void close() {
+    public synchronized void close() {
         if (listener != null) {
             listener.unreg();
             listener = null;
@@ -324,12 +322,7 @@
         if (allListener != null) {
             allListener.shutdown();
         }
-        if (jmsConfig.getWrappedConnectionFactory() != null) {
-            ConnectionFactory f = jmsConfig.getWrappedConnectionFactory();
-            if (f instanceof SingleConnectionFactory) {
-                ((SingleConnectionFactory)f).destroy();
-            }
-        }
+        jmsConfig.destroyWrappedConnectionFactory();
         LOG.log(Level.FINE, "JMSConduit closed ");
     }
 

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=811477&r1=811476&r2=811477&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Fri Sep  4 16:36:37 2009
@@ -435,6 +435,17 @@
     public ConnectionFactory getWrappedConnectionFactory() {
         return wrappedConnectionFactory;
     }
+    
+    public synchronized void destroyWrappedConnectionFactory() {
+        if (wrappedConnectionFactory instanceof SingleConnectionFactory) {
+            ((SingleConnectionFactory)wrappedConnectionFactory).destroy();
+            if (connectionFactory == wrappedConnectionFactory) {
+                connectionFactory = null;
+            }
+            wrappedConnectionFactory = null;
+        }
+    }
+    
     /**
      * Only for tests
      * @return



Mime
View raw message