activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1382283 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob: BlobDownloader.java BlobTransferPolicy.java BlobUploader.java
Date Sat, 08 Sep 2012 11:38:15 GMT
Author: davsclaus
Date: Sat Sep  8 11:38:15 2012
New Revision: 1382283

URL: http://svn.apache.org/viewvc?rev=1382283&view=rev
Log:
AMQ-4002: Fixed issue with blob transfer policy should be copied when used to avoid sharing
with multiple consumers. Thanks to Antoine for the patch.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobDownloader.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobDownloader.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobDownloader.java?rev=1382283&r1=1382282&r2=1382283&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobDownloader.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobDownloader.java
Sat Sep  8 11:38:15 2012
@@ -27,10 +27,11 @@ import org.apache.activemq.command.Activ
  */
 public class BlobDownloader {
 
-    private BlobTransferPolicy blobTransferPolicy;
+    private final BlobTransferPolicy blobTransferPolicy;
     
     public BlobDownloader(BlobTransferPolicy transferPolicy) {
-        this.blobTransferPolicy = transferPolicy;
+        // need to do a defensive copy
+        this.blobTransferPolicy = transferPolicy.copy();
     }
     
     public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException
{

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java?rev=1382283&r1=1382282&r2=1382283&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobTransferPolicy.java
Sat Sep  8 11:38:15 2012
@@ -42,7 +42,9 @@ public class BlobTransferPolicy {
         that.defaultUploadUrl = this.defaultUploadUrl;
         that.brokerUploadUrl = this.brokerUploadUrl;
         that.uploadUrl = this.uploadUrl;
+        that.bufferSize = this.bufferSize;
         that.uploadStrategy = this.uploadStrategy;
+        that.downloadStrategy = this.downloadStrategy;
         return that;
     }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java?rev=1382283&r1=1382282&r2=1382283&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/blob/BlobUploader.java
Sat Sep  8 11:38:15 2012
@@ -32,17 +32,19 @@ import org.apache.activemq.command.Activ
  */
 public class BlobUploader {
 
-    private BlobTransferPolicy blobTransferPolicy;
+    private final BlobTransferPolicy blobTransferPolicy;
     private File file;
     private InputStream in;
 
     public BlobUploader(BlobTransferPolicy blobTransferPolicy, InputStream in) {
-        this.blobTransferPolicy = blobTransferPolicy;
+        // need to do a defensive copy
+        this.blobTransferPolicy = blobTransferPolicy.copy();
         this.in = in;
     }
 
     public BlobUploader(BlobTransferPolicy blobTransferPolicy, File file) {
-        this.blobTransferPolicy = blobTransferPolicy;
+        // need to do a defensive copy
+        this.blobTransferPolicy = blobTransferPolicy.copy();
         this.file = file;
     }
 



Mime
View raw message