servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r773861 - /servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
Date Tue, 12 May 2009 11:20:27 GMT
Author: ffang
Date: Tue May 12 11:20:27 2009
New Revision: 773861

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

Modified:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=773861&r1=773860&r2=773861&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
Tue May 12 11:20:27 2009
@@ -710,16 +710,17 @@
             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.isOneway) {
+                    CxfBcConsumer.this.messages.put(exchange.getExchangeId(), message);
                     context.getDeliveryChannel().sendSync(exchange,
                             timeout * 1000);
                     process(exchange);
@@ -730,6 +731,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);
@@ -737,6 +739,7 @@
                         } else {
                             //retry or timeout
                             if (!continuation.isResumed()) {
+                                messages.remove(exchange.getExchangeId());
                                 //exchange timeout
                                 throw new Exception("Exchange timed out: " + exchange.getExchangeId());
                             }



Mime
View raw message