activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Remove use of deprecated use MessageImpl and load the Proton MessageFactory instead.
Date Thu, 20 Mar 2014 17:05:27 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk af9134a4f -> 13b33da37


Remove use of deprecated use MessageImpl and load the Proton
MessageFactory instead.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/13b33da3
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/13b33da3
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/13b33da3

Branch: refs/heads/trunk
Commit: 13b33da37b0c884b61a7923e1b4947f60b2d9f69
Parents: af9134a
Author: Timothy Bish <tabish121@gmai.com>
Authored: Thu Mar 20 13:05:19 2014 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Thu Mar 20 13:05:19 2014 -0400

----------------------------------------------------------------------
 .../activemq/transport/amqp/AmqpProtocolConverter.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/13b33da3/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
index fe810ff..71a26e0 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
@@ -58,6 +58,7 @@ import org.apache.activemq.selector.SelectorParser;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.IdGenerator;
 import org.apache.activemq.util.LongSequenceGenerator;
+import org.apache.qpid.proton.ProtonFactoryLoader;
 import org.apache.qpid.proton.amqp.Binary;
 import org.apache.qpid.proton.amqp.DescribedType;
 import org.apache.qpid.proton.amqp.Symbol;
@@ -98,7 +99,8 @@ import org.apache.qpid.proton.jms.EncodedMessage;
 import org.apache.qpid.proton.jms.InboundTransformer;
 import org.apache.qpid.proton.jms.JMSMappingInboundTransformer;
 import org.apache.qpid.proton.jms.OutboundTransformer;
-import org.apache.qpid.proton.message.impl.MessageImpl;
+import org.apache.qpid.proton.message.Message;
+import org.apache.qpid.proton.message.MessageFactory;
 import org.fusesource.hawtbuf.Buffer;
 import org.fusesource.hawtbuf.ByteArrayOutputStream;
 import org.slf4j.Logger;
@@ -120,11 +122,15 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
     private static final Symbol NO_LOCAL = Symbol.valueOf("no-local");
     private static final Symbol DURABLE_SUBSCRIPTION_ENDED = Symbol.getSymbol("DURABLE_SUBSCRIPTION_ENDED");
 
+    private static final ProtonFactoryLoader<MessageFactory> messageFactoryLoader =
+        new ProtonFactoryLoader<MessageFactory>(MessageFactory.class);
+
     int prefetch = 100;
 
     EngineFactory engineFactory = new EngineFactoryImpl();
     Transport protonTransport = engineFactory.createTransport();
     Connection protonConnection = engineFactory.createConnection();
+    MessageFactory messageFactory = messageFactoryLoader.loadFactory();
 
     public AmqpProtocolConverter(AmqpTransport transport) {
         this.amqpTransport = transport;
@@ -630,7 +636,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
         @Override
         protected void onMessage(Receiver receiver, final Delivery delivery, Buffer buffer)
throws Exception {
 
-            MessageImpl msg = new MessageImpl();
+            Message msg = messageFactory.createMessage();
             int offset = buffer.offset;
             int len = buffer.length;
             while (len > 0) {


Mime
View raw message