qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1776271 - in /qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp: ManagementNodeConsumer.java ManagementResponse.java
Date Wed, 28 Dec 2016 11:34:44 GMT
Author: kwall
Date: Wed Dec 28 11:34:44 2016
New Revision: 1776271

URL: http://svn.apache.org/viewvc?rev=1776271&view=rev
Log:
QPID-6028: [Java Broker] ManagementNodeConsumer must take a message reference whilst it retains
responsibility for the message - fixes NPE exposed by r1776037

Modified:
    qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNodeConsumer.java
    qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementResponse.java

Modified: qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNodeConsumer.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNodeConsumer.java?rev=1776271&r1=1776270&r2=1776271&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNodeConsumer.java
(original)
+++ qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNodeConsumer.java
Wed Dec 28 11:34:44 2016
@@ -89,7 +89,9 @@ class ManagementNodeConsumer<T extends C
             if (!_target.isSuspended() && _target.allocateCredit(managementResponse.getMessage()))
             {
                 _queue.remove(0);
-                return new MessageContainer(managementResponse, null, false);
+                return new MessageContainer(managementResponse,
+                                            managementResponse.getMessageReference(),
+                                            false);
             }
         }
         return null;
@@ -197,7 +199,7 @@ class ManagementNodeConsumer<T extends C
         return _managementNode;
     }
 
-    void send(ManagementResponse responseEntry)
+    private void send(ManagementResponse responseEntry)
     {
         _queue.add(responseEntry);
         _target.notifyWork();

Modified: qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementResponse.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementResponse.java?rev=1776271&r1=1776270&r2=1776271&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementResponse.java
(original)
+++ qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementResponse.java
Wed Dec 28 11:34:44 2016
@@ -24,6 +24,7 @@ import org.apache.qpid.server.filter.Fil
 import org.apache.qpid.server.message.InstanceProperties;
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.message.MessageInstanceConsumer;
+import org.apache.qpid.server.message.MessageReference;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.message.internal.InternalMessage;
 import org.apache.qpid.server.store.MessageEnqueueRecord;
@@ -35,16 +36,19 @@ import org.apache.qpid.server.util.State
 class ManagementResponse implements MessageInstance
 {
     private final ManagementNodeConsumer _consumer;
+    private final MessageReference _messageReference;
     private int _deliveryCount;
     private boolean _isRedelivered;
     private boolean _isDelivered;
     private boolean _isDeleted;
     private InternalMessage _message;
 
-    ManagementResponse(final ManagementNodeConsumer consumer, final InternalMessage message)
+    ManagementResponse(final ManagementNodeConsumer consumer,
+                       final InternalMessage message)
     {
         _consumer = consumer;
         _message = message;
+        _messageReference = _message.newReference(consumer);
     }
 
     @Override
@@ -253,4 +257,9 @@ class ManagementResponse implements Mess
     {
         return _consumer.getManagementNode();
     }
+
+    public MessageReference getMessageReference()
+    {
+        return _messageReference;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message