servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r773843 - /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
Date Tue, 12 May 2009 10:54:32 GMT
Author: ffang
Date: Tue May 12 10:54:31 2009
New Revision: 773843

URL: http://svn.apache.org/viewvc?rev=773843&view=rev
Log:
[SMXCOMP-536]potential memory leak for cxf continuation

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=773843&r1=773842&r2=773843&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
Tue May 12 10:54:31 2009
@@ -291,7 +291,7 @@
         }
         
         Message message = messages.remove(exchange.getExchangeId());
-                       
+                               
         synchronized (message.getInterceptorChain()) {
             boolean oneway = message.getExchange().get(
                     BindingOperationInfo.class).getOperationInfo().isOneWay();
@@ -714,15 +714,16 @@
             ComponentContext context = message.getExchange().get(
                     ComponentContext.class);
             CxfBcConsumer.this.configureExchangeTarget(exchange);
-            CxfBcConsumer.this.messages.put(exchange.getExchangeId(), message);
             CxfBcConsumer.this.isOneway = message.getExchange().get(
                     BindingOperationInfo.class).getOperationInfo().isOneWay();
             message.getExchange().setOneWay(CxfBcConsumer.this.isOneway);
 
             try {
                 if (CxfBcConsumer.this.isOneway) {
+                    CxfBcConsumer.this.messages.put(exchange.getExchangeId(), message);
                     context.getDeliveryChannel().send(exchange);
                 } else if (CxfBcConsumer.this.isSynchronous()) {
+                    CxfBcConsumer.this.messages.put(exchange.getExchangeId(), message);
                     context.getDeliveryChannel().sendSync(exchange,
                         timeout * 1000);
                     process(exchange);
@@ -733,6 +734,7 @@
                             (ContinuationProvider) message.get(ContinuationProvider.class.getName());
                         Continuation continuation = continuationProvider.getContinuation();
                         if (!continuation.isPending()) {
+                            CxfBcConsumer.this.messages.put(exchange.getExchangeId(), message);
                             context.getDeliveryChannel().send(exchange);
                             if (!isSTFlow) {
                                 continuation.suspend(timeout * 1000);
@@ -741,6 +743,7 @@
                             //retry or timeout
                             if (!continuation.isResumed()) {
                                 //exchange timeout
+                                messages.remove(exchange.getExchangeId());
                                 throw new Exception("Exchange timed out: " + exchange.getExchangeId());
                             }
                                                        



Mime
View raw message