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 2012/03/02 21:53:47 UTC

svn commit: r1296453 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Author: dkulp
Date: Fri Mar  2 20:53:46 2012
New Revision: 1296453

URL: http://svn.apache.org/viewvc?rev=1296453&view=rev
Log:
[CXF-4131] Make sure the conduit is only added as a listener once

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1296453&r1=1296452&r2=1296453&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Fri Mar  2 20:53:46 2012
@@ -427,6 +427,7 @@ public class HTTPConduit 
                                           getClient().getDecoupledEndpoint());
         }
         if (clientSidePolicy != null) {
+            clientSidePolicy.removePropertyChangeListener(this); //make sure we aren't added twice
             clientSidePolicy.addPropertyChangeListener(this);
         }
     }
@@ -715,7 +716,10 @@ public class HTTPConduit 
             }
             //defaultEndpointURL = null;
         }
-    
+        
+        if (clientSidePolicy != null) {
+            clientSidePolicy.removePropertyChangeListener(this);
+        }
     }
 
     /**
@@ -874,8 +878,12 @@ public class HTTPConduit 
      * method will override any HTTPClientPolicy set in configuration.
      */
     public void setClient(HTTPClientPolicy client) {
+        if (this.clientSidePolicy != null) {
+            this.clientSidePolicy.removePropertyChangeListener(this);
+        }
         this.clientSidePolicy = client;
-        client.addPropertyChangeListener(this);
+        clientSidePolicy.removePropertyChangeListener(this); //make sure we aren't added twice
+        clientSidePolicy.addPropertyChangeListener(this);
         endpointInfo.setProperty("org.apache.cxf.ws.addressing.replyto", client.getDecoupledEndpoint());
     }