You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/08/19 20:49:50 UTC
svn commit: r805927 - in /cxf/branches/2.2.x-fixes: ./
integration/jca/src/main/java/org/apache/cxf/jca/outbound/
rt/core/src/main/java/org/apache/cxf/endpoint/
rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/
Author: dkulp
Date: Wed Aug 19 18:49:49 2009
New Revision: 805927
URL: http://svn.apache.org/viewvc?rev=805927&view=rev
Log:
Merged revisions 805907 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r805907 | dkulp | 2009-08-19 14:08:31 -0400 (Wed, 19 Aug 2009) | 2 lines
[CXF-2398] Make sure close() is called on the conduits for JCA. Heavily
modified patch from Seumas Soltysik applied.
........
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/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.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 Wed Aug 19 18:49:49 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,798891,798929-798930,799245,799267,799439,799448,799637,799723-799724,799792,800453,800497-800498,801380-801381,801447,801962,802892,803129,803460,803493,803689,804002,804276,805784
+/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,798891,798929-798930,799245,799267,799439,799448,799637,799723-799724,799792,800453,800497-800498,801380-801381,801447,801962,802892,803129,803460,803493,803689,804002,804276,805784,805907
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=805927&r1=805926&r2=805927&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 Wed Aug 19 18:49:49 2009
@@ -50,6 +50,8 @@
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxws.EndpointUtils;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
@@ -394,9 +396,8 @@
}
private Object handleCloseMethod(Object proxy, Method method,
- Object[] args) {
+ Object[] args) {
-
handles.remove(proxy);
associatedHandle = null;
ConnectionEvent event = new ConnectionEvent(ManagedConnectionImpl.this,
@@ -404,6 +405,11 @@
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/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=805927&r1=805926&r2=805927&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Wed Aug 19 18:49:49 2009
@@ -158,13 +158,14 @@
}
public void destroy() {
-
- // TODO: also inform the conduit so it can shutdown any response listeners
-
ClientLifeCycleManager mgr = bus.getExtension(ClientLifeCycleManager.class);
if (null != mgr) {
mgr.clientDestroyed(this);
}
+
+ if (conduitSelector != null) {
+ getConduit().close();
+ }
}
private void notifyLifecycleManager() {
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=805927&r1=805926&r2=805927&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 Wed Aug 19 18:49:49 2009
@@ -32,6 +32,7 @@
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;
@@ -49,6 +50,7 @@
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.DefaultMessageListenerContainer;
@@ -308,6 +310,12 @@
if (allListener != null) {
allListener.shutdown();
}
+ if (jmsConfig.getWrappedConnectionFactory() != null) {
+ ConnectionFactory f = jmsConfig.getWrappedConnectionFactory();
+ if (f instanceof SingleConnectionFactory) {
+ ((SingleConnectionFactory)f).destroy();
+ }
+ }
LOG.log(Level.FINE, "JMSConduit closed ");
}
@@ -330,16 +338,7 @@
@Override
protected void finalize() throws Throwable {
- if (listener != null) {
- listener.unreg();
- listener = null;
- }
- if (jmsListener != null) {
- jmsListener.shutdown();
- }
- if (allListener != null) {
- allListener.shutdown();
- }
+ close();
super.finalize();
}
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=805927&r1=805926&r2=805927&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 Wed Aug 19 18:49:49 2009
@@ -405,7 +405,7 @@
*
* @return usable connectionFactory
*/
- public ConnectionFactory getOrCreateWrappedConnectionFactory() {
+ public synchronized ConnectionFactory getOrCreateWrappedConnectionFactory() {
if (wrappedConnectionFactory == null) {
if (connectionFactory == null) {
connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
@@ -432,7 +432,9 @@
}
return wrappedConnectionFactory;
}
-
+ public ConnectionFactory getWrappedConnectionFactory() {
+ return wrappedConnectionFactory;
+ }
/**
* Only for tests
* @return