qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Refactor send handling a bit, do all message prep in client thread during the onSend method. Pass producer configuation to message onSend so the facade can decide what to include in sent message.
Date Wed, 01 Oct 2014 20:25:42 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master 72639ba7b -> cf38f9b0c


Refactor send handling a bit, do all message prep in client thread
during the onSend method.  Pass producer configuation to message onSend
so the facade can decide what to include in sent message.  

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/cf38f9b0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/cf38f9b0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/cf38f9b0

Branch: refs/heads/master
Commit: cf38f9b0c4ce0c5a4c7eac22dae6cb68d85fc0fd
Parents: 72639ba
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Oct 1 16:25:35 2014 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Oct 1 16:25:35 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/qpid/jms/JmsSession.java    | 20 +++++-----
 .../qpid/jms/message/JmsBytesMessage.java       |  4 +-
 .../org/apache/qpid/jms/message/JmsMessage.java | 11 ++++-
 .../jms/message/JmsOutboundMessageDispatch.java | 14 -------
 .../qpid/jms/message/JmsStreamMessage.java      |  4 +-
 .../jms/message/facade/JmsMessageFacade.java    | 13 +++++-
 .../jms/provider/amqp/AmqpFixedProducer.java    | 22 ----------
 .../amqp/message/AmqpJmsMessageFacade.java      | 42 +++++++++++++++-----
 .../message/AmqpJmsObjectMessageFacade.java     |  3 +-
 .../qpid/jms/message/JmsBytesMessageTest.java   | 14 +++----
 .../qpid/jms/message/JmsMapMessageTest.java     |  6 +--
 .../qpid/jms/message/JmsObjectMessageTest.java  | 10 ++---
 .../defaults/JmsDefaultMessageFacade.java       |  2 +-
 13 files changed, 83 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
index 5a808e4..0c8b812 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
@@ -633,11 +633,8 @@ public class JmsSession implements Session, QueueSession, TopicSession,
JmsMessa
             original.setJMSPriority(priority);
             original.setJMSRedelivered(false);
 
-            long timeStamp = 0;
+            long timeStamp = System.currentTimeMillis();
             boolean hasTTL = timeToLive > 0;
-            if (!disableTimestamp || hasTTL) {
-                timeStamp = System.currentTimeMillis();
-            }
 
             if (!disableTimestamp) {
                 original.setJMSTimestamp(timeStamp);
@@ -647,13 +644,14 @@ public class JmsSession implements Session, QueueSession, TopicSession,
JmsMessa
 
             if (hasTTL) {
                 original.setJMSExpiration(timeStamp + timeToLive);
+            } else {
+                original.setJMSExpiration(0);
             }
 
-            String msgId = null;
+            String msgId = getNextMessageId(producer);;
             if (!disableMsgId) {
-                msgId = getNextMessageId(producer);
+                original.setJMSMessageID(msgId);
             }
-            original.setJMSMessageID(msgId);
 
             boolean isJmsMessageType = original instanceof JmsMessage;
             if (isJmsMessageType) {
@@ -669,12 +667,16 @@ public class JmsSession implements Session, QueueSession, TopicSession,
JmsMessa
                 copy.setJMSDestination(destination);
             }
 
+            // We always set these on the copy, broker might require them even if client
+            // has asked to not include them.
+            copy.setJMSMessageID(msgId);
+            copy.setJMSTimestamp(timeStamp);
+
             boolean sync = connection.isAlwaysSyncSend() ||
                            (!connection.isForceAsyncSend() && deliveryMode == DeliveryMode.PERSISTENT
&& !getTransacted());
 
-            copy.onSend();
+            copy.onSend(disableMsgId, disableTimestamp, timeToLive);
             JmsOutboundMessageDispatch envelope = new JmsOutboundMessageDispatch();
-            envelope.setTtl(timeToLive);
             envelope.setMessage(copy);
             envelope.setProducerId(producer.getProducerId());
             envelope.setDestination(destination);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsBytesMessage.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsBytesMessage.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsBytesMessage.java
index 90cab53..eaf101e 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsBytesMessage.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsBytesMessage.java
@@ -113,9 +113,9 @@ public class JmsBytesMessage extends JmsMessage implements BytesMessage
{
     }
 
     @Override
-    public void onSend() throws JMSException {
+    public void onSend(boolean disableMsgId, boolean disableTimestamp, long producerTtl)
throws JMSException {
         this.storeContent();
-        super.onSend();
+        super.onSend(disableMsgId, disableTimestamp, producerTtl);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsMessage.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsMessage.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsMessage.java
index 180a2b7..d170e3b 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsMessage.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsMessage.java
@@ -518,12 +518,19 @@ public class JmsMessage implements javax.jms.Message {
      * ready to be written to the wire.  This processing can include such tasks as ensuring
      * that the proper message headers are set or compressing message bodies etc.
      *
+     * @param disableMessageId
+     *        a hint that the user requested not to sent the MessageID if possible.
+     * @param disableTimestamp
+     *        a hint that the user requested not to sent the MessageID if possible.
+     * @param producerTtl
+     *        the time to live value that the producer was configured with at send time.
+     *
      * @throws JMSException if an error occurs while preparing the message for send.
      */
-    public void onSend() throws JMSException {
+    public void onSend(boolean disableMessageId, boolean disableTimestamp, long producerTtl)
throws JMSException {
         setReadOnlyBody(true);
         setReadOnlyProperties(true);
-        facade.onSend();
+        facade.onSend(disableMessageId, disableTimestamp, producerTtl);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsOutboundMessageDispatch.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsOutboundMessageDispatch.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsOutboundMessageDispatch.java
index ffa50ec..44e211f 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsOutboundMessageDispatch.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsOutboundMessageDispatch.java
@@ -29,7 +29,6 @@ public class JmsOutboundMessageDispatch {
     private JmsDestination destination;
     private boolean sendAsync;
     private String dispatchId;
-    private long ttl;
 
     public JmsDestination getDestination() {
         return destination;
@@ -67,19 +66,6 @@ public class JmsOutboundMessageDispatch {
         this.dispatchId = dispatchId;
     }
 
-    /**
-     * The ttl value used during the send operation.
-     *
-     * @param ttl value in ms, which may be 0 if none was used
-     */
-    public void setTtl(long ttl) {
-        this.ttl = ttl;
-    }
-
-    public long getTtl() {
-        return ttl;
-    }
-
     @Override
     public String toString() {
         String result = "JmsOutboundMessageDispatch {dispatchId = ";

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsStreamMessage.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsStreamMessage.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsStreamMessage.java
index bd4f0fe..b293274 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsStreamMessage.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/JmsStreamMessage.java
@@ -47,8 +47,8 @@ public class JmsStreamMessage extends JmsMessage implements StreamMessage
{
     }
 
     @Override
-    public void onSend() throws JMSException {
-        super.onSend();
+    public void onSend(boolean disableMessageId, boolean disableTimestamp, long producerTtl)
throws JMSException {
+        super.onSend(disableMessageId, disableTimestamp, producerTtl);
         reset();
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
index 3dd174b..3bd3b55 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
@@ -81,9 +81,20 @@ public interface JmsMessageFacade {
      * contents from a logical data structure to a binary form for transmission, or
      * other processing such as setting proper message headers etc.
      *
+     * The method allows for passing through producer configuration details not
+     * explicitly mapped into the JMS Message allowing the facade to create the
+     * most correct and compact message on the wire.
+     *
+     * @param disableMessageId
+     *        a hint that the user requested not to send the MessageID if possible.
+     * @param disableTimestamp
+     *        a hint that the user requested not to send the time stamp if possible.
+     * @param producerTtl
+     *        the time to live value configured on the producer when sent.
+     *
      * @throws JMSException if an error occurs while preparing the message for send.
      */
-    void onSend() throws JMSException;
+    void onSend(boolean disableMessageId, boolean disableTimestamp, long producerTtl) throws
JMSException;
 
     /**
      * Called before a message is dispatched to its intended consumer to allow for

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
index 2c2f060..615f429 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
@@ -34,7 +34,6 @@ import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade;
 import org.apache.qpid.jms.util.IOExceptionSupport;
 import org.apache.qpid.proton.amqp.Binary;
 import org.apache.qpid.proton.amqp.messaging.Accepted;
-import org.apache.qpid.proton.amqp.messaging.Header;
 import org.apache.qpid.proton.amqp.messaging.Outcome;
 import org.apache.qpid.proton.amqp.messaging.Rejected;
 import org.apache.qpid.proton.amqp.messaging.Source;
@@ -57,7 +56,6 @@ import org.slf4j.LoggerFactory;
 public class AmqpFixedProducer extends AmqpProducer {
 
     private static final Logger LOG = LoggerFactory.getLogger(AmqpFixedProducer.class);
-    private static final long UINT_MAX = 0xFFFFFFFFL;
     private static final byte[] EMPTY_BYTE_ARRAY = new byte[] {};
 
     private final AmqpTransferTagGenerator tagGenerator = new AmqpTransferTagGenerator(true);
@@ -124,26 +122,6 @@ public class AmqpFixedProducer extends AmqpProducer {
         }
 
         AmqpJmsMessageFacade amqpMessageFacade = (AmqpJmsMessageFacade) facade;
-        Message amqpMessage = amqpMessageFacade.getAmqpMessage();
-
-        // Set the ttl field of the Header field if needed, complementing the expiration
-        // field of Properties for any peers that only inspect the mutable ttl field.
-        long ttl = 0;
-        if (amqpMessageFacade.hasUserSpecifiedTimeToLive()) {
-            ttl = amqpMessageFacade.getAmqpTimeToLive();
-        } else {
-            ttl = envelope.getTtl();
-        }
-
-        if (ttl > 0 && ttl < UINT_MAX) {
-            amqpMessage.setTtl(ttl);
-        } else {
-            Header hdr = amqpMessage.getHeader();
-            if (hdr != null) {
-                hdr.setTtl(null);
-            }
-        }
-
         encodeAndSend(amqpMessageFacade.getAmqpMessage(), delivery);
 
         if (presettle) {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
index 1b7c92d..295122b 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
@@ -57,7 +57,7 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade {
 
     private static final int DEFAULT_PRIORITY = javax.jms.Message.DEFAULT_PRIORITY;
     private static final Charset UTF8 = Charset.forName("UTF-8");
-    private static final long MAX_UINT = 0xFFFFFFFFL;
+    private static final long UINT_MAX = 0xFFFFFFFFL;
 
     protected final Message message;
     protected final AmqpConnection connection;
@@ -210,21 +210,41 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade {
     }
 
     @Override
-    public void onSend() throws JMSException {
-        // TODO - Why is this here ?? Seems to be circular reading and reseting
-        String contentType = getContentType();
-        if (contentType != null) {
-            message.setContentType(contentType);
+    public void onSend(boolean disableMsgId, boolean disableTimestamp, long producerTtl)
throws JMSException {
+
+        // Set the ttl field of the Header field if needed, complementing the expiration
+        // field of Properties for any peers that only inspect the mutable ttl field.
+        long ttl = 0;
+        if (hasUserSpecifiedTimeToLive()) {
+            ttl = getAmqpTimeToLive();
+        } else {
+            ttl = producerTtl;
+        }
+
+        if (ttl > 0 && ttl < UINT_MAX) {
+            message.setTtl(ttl);
+        } else {
+            Header hdr = message.getHeader();
+            if (hdr != null) {
+                hdr.setTtl(null);
+            }
+        }
+
+        if (disableMsgId) {
+            // TODO - ActiveMQ will synthesize a message Id, but I don't think it has been
+            //        really well tested, so we should investigate before enabling this.
+            // setMessageId(null);
+        }
+
+        if (disableTimestamp) {
+            setTimestamp(0);
         }
 
-        byte jmsMsgType = getJmsMsgType();
-        setAnnotation(JMS_MSG_TYPE, jmsMsgType);
+        setAnnotation(JMS_MSG_TYPE, getJmsMsgType());
     }
 
     @Override
     public void onDispatch() throws JMSException {
-        // TODO - Sort out send vs dispatch processing.
-        onSend();
     }
 
     @Override
@@ -578,7 +598,7 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade {
     }
 
     public void setAmqpTimeToLive(long ttl) throws MessageFormatException {
-        if (ttl >= 0 && ttl <= MAX_UINT) {
+        if (ttl >= 0 && ttl <= UINT_MAX) {
             userSpecifiedTTL = ttl;
         } else {
             throw new MessageFormatException(JMS_AMQP_TTL + " must be a long with value in
range 0 to 2^32 - 1");

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
index 694192b..0b3d51d 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
@@ -119,7 +119,8 @@ public class AmqpJmsObjectMessageFacade extends AmqpJmsMessageFacade implements
     }
 
     @Override
-    public void onSend() {
+    public void onSend(boolean disableMsgId, boolean disableTimestamp, long producerTtl)
throws JMSException {
+        super.onSend(disableMsgId, disableTimestamp, producerTtl);
         delegate.onSend();
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsBytesMessageTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsBytesMessageTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsBytesMessageTest.java
index e3f1ac5..7a103a1 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsBytesMessageTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsBytesMessageTest.java
@@ -72,7 +72,7 @@ public class JmsBytesMessageTest {
     @Test
     public void testReadBytesUsingReceivedMessageWithNoBodyReturnsEOS() throws Exception
{
         JmsBytesMessage bytesMessage = factory.createBytesMessage();
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
         //verify attempting to read bytes returns -1, i.e EOS
         assertEquals("Expected input stream to be at end but data was returned", END_OF_STREAM,
bytesMessage.readBytes(new byte[1]));
     }
@@ -84,7 +84,7 @@ public class JmsBytesMessageTest {
         facade.setContent(content);
 
         JmsBytesMessage bytesMessage = new JmsBytesMessage(facade);
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
 
         // retrieve the expected bytes, check they match
         byte[] receivedBytes = new byte[content.array().length];
@@ -109,7 +109,7 @@ public class JmsBytesMessageTest {
         facade.setContent(content);
 
         JmsBytesMessage bytesMessage = new JmsBytesMessage(facade);
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
         bytesMessage.writeBytes(content.array());
     }
 
@@ -135,7 +135,7 @@ public class JmsBytesMessageTest {
         facade.setContent(content);
 
         JmsBytesMessage bytesMessage = new JmsBytesMessage(facade);
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
         assertTrue("Message should not be writable", bytesMessage.isReadOnlyBody());
         bytesMessage.clearBody();
         assertFalse("Message should be writable", bytesMessage.isReadOnlyBody());
@@ -152,7 +152,7 @@ public class JmsBytesMessageTest {
         facade.setContent(content);
 
         JmsBytesMessage bytesMessage = new JmsBytesMessage(facade);
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
 
         assertNotNull("Expected message content but none was present", facade.getContent());
         bytesMessage.clearBody();
@@ -170,7 +170,7 @@ public class JmsBytesMessageTest {
         facade.setContent(content);
 
         JmsBytesMessage bytesMessage = new JmsBytesMessage(facade);
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
         assertEquals("Unexpected message length", content.array().length, bytesMessage.getBodyLength());
         bytesMessage.clearBody();
 
@@ -193,7 +193,7 @@ public class JmsBytesMessageTest {
         facade.setContent(content);
 
         JmsBytesMessage bytesMessage = new JmsBytesMessage(facade);
-        bytesMessage.onSend();
+        bytesMessage.onDispatch();
 
         // retrieve a few bytes, check they match the first few expected bytes
         byte[] partialBytes = new byte[3];

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
index 648ab7d..e8a1889 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
@@ -31,8 +31,6 @@ import javax.jms.JMSException;
 import javax.jms.MessageFormatException;
 import javax.jms.MessageNotWriteableException;
 
-import org.apache.qpid.jms.message.JmsMapMessage;
-import org.apache.qpid.jms.message.JmsMessageFactory;
 import org.apache.qpid.jms.message.facade.JmsMapMessageFacade;
 import org.apache.qpid.jms.message.facade.defaults.JmsDefaultMapMessageFacade;
 import org.apache.qpid.jms.message.facade.defaults.JmsDefaultMessageFactory;
@@ -114,7 +112,7 @@ public class JmsMapMessageTest {
         String myKey1 = "key1";
         facade.put(myKey1, "value1");
         JmsMapMessage mapMessage = new JmsMapMessage(facade);
-        mapMessage.onSend();
+        mapMessage.onDispatch();
 
         try {
             mapMessage.setObject("name", "value");
@@ -134,7 +132,7 @@ public class JmsMapMessageTest {
         facade.put(myKey1, "value1");
 
         JmsMapMessage mapMessage = new JmsMapMessage(facade);
-        mapMessage.onSend();
+        mapMessage.onDispatch();
 
         assertTrue("expected message to be read-only", mapMessage.isReadOnlyBody());
         mapMessage.clearBody();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsObjectMessageTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsObjectMessageTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsObjectMessageTest.java
index 7ca6b79..77ab160 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsObjectMessageTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsObjectMessageTest.java
@@ -36,8 +36,6 @@ import javax.jms.MessageNotReadableException;
 import javax.jms.MessageNotWriteableException;
 import javax.jms.ObjectMessage;
 
-import org.apache.qpid.jms.message.JmsMessageFactory;
-import org.apache.qpid.jms.message.JmsObjectMessage;
 import org.apache.qpid.jms.message.facade.JmsObjectMessageFacade;
 import org.apache.qpid.jms.message.facade.defaults.JmsDefaultMessageFactory;
 import org.apache.qpid.jms.message.facade.defaults.JmsDefaultObjectMessageFacade;
@@ -61,7 +59,7 @@ public class JmsObjectMessageTest {
         JmsObjectMessageFacade facade = new JmsDefaultObjectMessageFacade();
         facade.setObject(content);
         JmsObjectMessage objectMessage = new JmsObjectMessage(facade);
-        objectMessage.onSend();
+        objectMessage.onDispatch();
 
         try {
             objectMessage.setObject("newObject");
@@ -81,7 +79,7 @@ public class JmsObjectMessageTest {
         JmsObjectMessageFacade facade = new JmsDefaultObjectMessageFacade();
         facade.setObject(content);
         JmsObjectMessage objectMessage = new JmsObjectMessage(facade);
-        objectMessage.onSend();
+        objectMessage.onDispatch();
 
         assertTrue("Message should not be writable", objectMessage.isReadOnlyBody());
         objectMessage.clearBody();
@@ -98,7 +96,7 @@ public class JmsObjectMessageTest {
         JmsDefaultObjectMessageFacade facade = new JmsDefaultObjectMessageFacade();
         facade.setObject(content);
         JmsObjectMessage objectMessage = new JmsObjectMessage(facade);
-        objectMessage.onSend();
+        objectMessage.onDispatch();
 
         assertNotNull("Expected body section but none was present", facade.getSerializedObject());
         objectMessage.clearBody();
@@ -123,7 +121,7 @@ public class JmsObjectMessageTest {
         JmsDefaultObjectMessageFacade facade = new JmsDefaultObjectMessageFacade();
         facade.setObject((Serializable) origMap);
         JmsObjectMessage objectMessage = new JmsObjectMessage(facade);
-        objectMessage.onSend();
+        objectMessage.onDispatch();
 
         // verify we get a different-but-equal object back
         Serializable serialized = objectMessage.getObject();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cf38f9b0/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
index eff3ad7..a6852ab 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
@@ -122,7 +122,7 @@ public class JmsDefaultMessageFacade implements JmsMessageFacade {
     }
 
     @Override
-    public void onSend() throws JMSException {
+    public void onSend(boolean disableMessageId, boolean disableTimestamp, long producerTtl)
throws JMSException {
     }
 
     @Override


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


Mime
View raw message