activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [08/15] activemq-artemis git commit: ARTEMIS-751 Simplification of the AMQP implementation
Date Tue, 27 Sep 2016 13:54:35 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/DeliveryUtil.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/DeliveryUtil.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/DeliveryUtil.java
new file mode 100644
index 0000000..9257c6b
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/DeliveryUtil.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.util;
+
+import io.netty.buffer.ByteBuf;
+import org.apache.qpid.proton.engine.Receiver;
+import org.apache.qpid.proton.message.Message;
+import org.apache.qpid.proton.message.impl.MessageImpl;
+
+public class DeliveryUtil {
+
+   public static int readDelivery(Receiver receiver, ByteBuf buffer) {
+      int initial = buffer.writerIndex();
+      // optimization by norman
+      int count;
+      while ((count = receiver.recv(buffer.array(), buffer.arrayOffset() + buffer.writerIndex(), buffer.writableBytes())) > 0) {
+         // Increment the writer index by the number of bytes written into it while calling recv.
+         buffer.writerIndex(buffer.writerIndex() + count);
+         buffer.ensureWritable(count);
+      }
+      return buffer.writerIndex() - initial;
+   }
+
+   public static MessageImpl decodeMessageImpl(ByteBuf buffer) {
+      MessageImpl message = (MessageImpl) Message.Factory.create();
+      message.decode(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), buffer.readableBytes());
+      return message;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java
new file mode 100644
index 0000000..75d39b6
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.util;
+
+import java.nio.ByteBuffer;
+
+import io.netty.buffer.ByteBuf;
+import org.apache.qpid.proton.codec.WritableBuffer;
+
+/**
+ * This is to use NettyBuffer within Proton
+ */
+
+public class NettyWritable implements WritableBuffer {
+
+   final ByteBuf nettyBuffer;
+
+   public NettyWritable(ByteBuf nettyBuffer) {
+      this.nettyBuffer = nettyBuffer;
+   }
+
+   @Override
+   public void put(byte b) {
+      nettyBuffer.writeByte(b);
+   }
+
+   @Override
+   public void putFloat(float f) {
+      nettyBuffer.writeFloat(f);
+   }
+
+   @Override
+   public void putDouble(double d) {
+      nettyBuffer.writeDouble(d);
+   }
+
+   @Override
+   public void put(byte[] src, int offset, int length) {
+      nettyBuffer.writeBytes(src, offset, length);
+   }
+
+   @Override
+   public void putShort(short s) {
+      nettyBuffer.writeShort(s);
+   }
+
+   @Override
+   public void putInt(int i) {
+      nettyBuffer.writeInt(i);
+   }
+
+   @Override
+   public void putLong(long l) {
+      nettyBuffer.writeLong(l);
+   }
+
+   @Override
+   public boolean hasRemaining() {
+      return nettyBuffer.writerIndex() < nettyBuffer.capacity();
+   }
+
+   @Override
+   public int remaining() {
+      return nettyBuffer.capacity() - nettyBuffer.writerIndex();
+   }
+
+   @Override
+   public int position() {
+      return nettyBuffer.writerIndex();
+   }
+
+   @Override
+   public void position(int position) {
+      nettyBuffer.writerIndex(position);
+   }
+
+   @Override
+   public void put(ByteBuffer payload) {
+      nettyBuffer.writeBytes(payload);
+   }
+
+   @Override
+   public int limit() {
+      return nettyBuffer.capacity();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/ProtonServerMessage.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/ProtonServerMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/ProtonServerMessage.java
new file mode 100644
index 0000000..c15741e
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/ProtonServerMessage.java
@@ -0,0 +1,470 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.util;
+
+import java.nio.ByteBuffer;
+
+import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
+import org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations;
+import org.apache.qpid.proton.amqp.messaging.Footer;
+import org.apache.qpid.proton.amqp.messaging.Header;
+import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
+import org.apache.qpid.proton.amqp.messaging.Properties;
+import org.apache.qpid.proton.amqp.messaging.Section;
+import org.apache.qpid.proton.codec.DecoderImpl;
+import org.apache.qpid.proton.codec.EncoderImpl;
+import org.apache.qpid.proton.codec.WritableBuffer;
+import org.apache.qpid.proton.message.MessageError;
+import org.apache.qpid.proton.message.ProtonJMessage;
+
+/**
+ * This is a serverMessage that won't deal with the body
+ */
+public class ProtonServerMessage implements ProtonJMessage {
+
+   private Header header;
+   private DeliveryAnnotations deliveryAnnotations;
+   private MessageAnnotations messageAnnotations;
+   private Properties properties;
+   private ApplicationProperties applicationProperties;
+
+   // This should include a raw body of both footer and body
+   private byte[] rawBody;
+
+   private Section parsedBody;
+   private Footer parsedFooter;
+
+   private final int EOF = 0;
+
+   // TODO: Enumerations maybe?
+   private static final int HEADER_TYPE = 0x070;
+   private static final int DELIVERY_ANNOTATIONS = 0x071;
+   private static final int MESSAGE_ANNOTATIONS = 0x072;
+   private static final int PROPERTIES = 0x073;
+   private static final int APPLICATION_PROPERTIES = 0x074;
+
+   /**
+    * This will decode a ByteBuffer tha represents the entire message.
+    * Set the limits around the parameter.
+    *
+    * @param buffer a limited buffer for the message
+    */
+   public void decode(ByteBuffer buffer) {
+
+      DecoderImpl decoder = CodecCache.getDecoder();
+
+      header = null;
+      deliveryAnnotations = null;
+      messageAnnotations = null;
+      properties = null;
+      applicationProperties = null;
+      rawBody = null;
+
+      decoder.setByteBuffer(buffer);
+      try {
+         int type = readType(buffer, decoder);
+         if (type == HEADER_TYPE) {
+            header = (Header) readSection(buffer, decoder);
+            type = readType(buffer, decoder);
+
+         }
+
+         if (type == DELIVERY_ANNOTATIONS) {
+            deliveryAnnotations = (DeliveryAnnotations) readSection(buffer, decoder);
+            type = readType(buffer, decoder);
+
+         }
+
+         if (type == MESSAGE_ANNOTATIONS) {
+            messageAnnotations = (MessageAnnotations) readSection(buffer, decoder);
+            type = readType(buffer, decoder);
+         }
+
+         if (type == PROPERTIES) {
+            properties = (Properties) readSection(buffer, decoder);
+            type = readType(buffer, decoder);
+
+         }
+
+         if (type == APPLICATION_PROPERTIES) {
+            applicationProperties = (ApplicationProperties) readSection(buffer, decoder);
+            type = readType(buffer, decoder);
+         }
+
+         if (type != EOF) {
+            rawBody = new byte[buffer.limit() - buffer.position()];
+            buffer.get(rawBody);
+         }
+      }
+      finally {
+         decoder.setByteBuffer(null);
+      }
+
+   }
+
+   public void encode(ByteBuffer buffer) {
+      WritableBuffer writableBuffer = new WritableBuffer.ByteBufferWrapper(buffer);
+      encode(writableBuffer);
+   }
+
+   @Override
+   public int encode(WritableBuffer writableBuffer) {
+      final int firstPosition = writableBuffer.position();
+
+      EncoderImpl encoder = CodecCache.getEncoder();
+      encoder.setByteBuffer(writableBuffer);
+
+      try {
+         if (header != null) {
+            encoder.writeObject(header);
+         }
+         if (deliveryAnnotations != null) {
+            encoder.writeObject(deliveryAnnotations);
+         }
+         if (messageAnnotations != null) {
+            encoder.writeObject(messageAnnotations);
+         }
+         if (properties != null) {
+            encoder.writeObject(properties);
+         }
+         if (applicationProperties != null) {
+            encoder.writeObject(applicationProperties);
+         }
+
+         // It should write either the parsed one or the rawBody
+         if (parsedBody != null) {
+            encoder.writeObject(parsedBody);
+            if (parsedFooter != null) {
+               encoder.writeObject(parsedFooter);
+            }
+         }
+         else if (rawBody != null) {
+            writableBuffer.put(rawBody, 0, rawBody.length);
+         }
+
+         return writableBuffer.position() - firstPosition;
+      }
+      finally {
+         encoder.setByteBuffer((WritableBuffer) null);
+      }
+   }
+
+   private int readType(ByteBuffer buffer, DecoderImpl decoder) {
+
+      int pos = buffer.position();
+
+      if (!buffer.hasRemaining()) {
+         return EOF;
+      }
+      try {
+         if (buffer.get() != 0) {
+            return EOF;
+         }
+         else {
+            return ((Number) decoder.readObject()).intValue();
+         }
+      }
+      finally {
+         buffer.position(pos);
+      }
+   }
+
+   private Section readSection(ByteBuffer buffer, DecoderImpl decoder) {
+      if (buffer.hasRemaining()) {
+         return (Section) decoder.readObject();
+      }
+      else {
+         return null;
+      }
+   }
+
+   // At the moment we only need encode implemented!!!
+   @Override
+   public boolean isDurable() {
+      return false;
+   }
+
+   @Override
+   public long getDeliveryCount() {
+      return 0;
+   }
+
+   @Override
+   public short getPriority() {
+      return 0;
+   }
+
+   @Override
+   public boolean isFirstAcquirer() {
+      return false;
+   }
+
+   @Override
+   public long getTtl() {
+      return 0;
+   }
+
+   @Override
+   public void setDurable(boolean durable) {
+
+   }
+
+   @Override
+   public void setTtl(long ttl) {
+
+   }
+
+   @Override
+   public void setDeliveryCount(long deliveryCount) {
+
+   }
+
+   @Override
+   public void setFirstAcquirer(boolean firstAcquirer) {
+
+   }
+
+   @Override
+   public void setPriority(short priority) {
+
+   }
+
+   @Override
+   public Object getMessageId() {
+      return null;
+   }
+
+   @Override
+   public long getGroupSequence() {
+      return 0;
+   }
+
+   @Override
+   public String getReplyToGroupId() {
+      return null;
+   }
+
+   @Override
+   public long getCreationTime() {
+      return 0;
+   }
+
+   @Override
+   public String getAddress() {
+      return null;
+   }
+
+   @Override
+   public byte[] getUserId() {
+      return new byte[0];
+   }
+
+   @Override
+   public String getReplyTo() {
+      return null;
+   }
+
+   @Override
+   public String getGroupId() {
+      return null;
+   }
+
+   @Override
+   public String getContentType() {
+      return null;
+   }
+
+   @Override
+   public long getExpiryTime() {
+      return 0;
+   }
+
+   @Override
+   public Object getCorrelationId() {
+      return null;
+   }
+
+   @Override
+   public String getContentEncoding() {
+      return null;
+   }
+
+   @Override
+   public String getSubject() {
+      return null;
+   }
+
+   @Override
+   public void setGroupSequence(long groupSequence) {
+
+   }
+
+   @Override
+   public void setUserId(byte[] userId) {
+
+   }
+
+   @Override
+   public void setCreationTime(long creationTime) {
+
+   }
+
+   @Override
+   public void setSubject(String subject) {
+
+   }
+
+   @Override
+   public void setGroupId(String groupId) {
+
+   }
+
+   @Override
+   public void setAddress(String to) {
+
+   }
+
+   @Override
+   public void setExpiryTime(long absoluteExpiryTime) {
+
+   }
+
+   @Override
+   public void setReplyToGroupId(String replyToGroupId) {
+
+   }
+
+   @Override
+   public void setContentEncoding(String contentEncoding) {
+
+   }
+
+   @Override
+   public void setContentType(String contentType) {
+
+   }
+
+   @Override
+   public void setReplyTo(String replyTo) {
+
+   }
+
+   @Override
+   public void setCorrelationId(Object correlationId) {
+
+   }
+
+   @Override
+   public void setMessageId(Object messageId) {
+
+   }
+
+   @Override
+   public Header getHeader() {
+      return null;
+   }
+
+   @Override
+   public DeliveryAnnotations getDeliveryAnnotations() {
+      return null;
+   }
+
+   @Override
+   public MessageAnnotations getMessageAnnotations() {
+      return null;
+   }
+
+   @Override
+   public Properties getProperties() {
+      return null;
+   }
+
+   @Override
+   public ApplicationProperties getApplicationProperties() {
+      return null;
+   }
+
+   @Override
+   public Section getBody() {
+      return null;
+   }
+
+   @Override
+   public Footer getFooter() {
+      return null;
+   }
+
+   @Override
+   public void setHeader(Header header) {
+
+   }
+
+   @Override
+   public void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations) {
+
+   }
+
+   @Override
+   public void setMessageAnnotations(MessageAnnotations messageAnnotations) {
+
+   }
+
+   @Override
+   public void setProperties(Properties properties) {
+
+   }
+
+   @Override
+   public void setApplicationProperties(ApplicationProperties applicationProperties) {
+
+   }
+
+   @Override
+   public void setBody(Section body) {
+
+   }
+
+   @Override
+   public void setFooter(Footer footer) {
+
+   }
+
+   @Override
+   public int decode(byte[] data, int offset, int length) {
+      return 0;
+   }
+
+   @Override
+   public int encode(byte[] data, int offset, int length) {
+      return 0;
+   }
+
+   @Override
+   public void clear() {
+
+   }
+
+   @Override
+   public MessageError getError() {
+      return null;
+   }
+
+   @Override
+   public int encode2(byte[] data, int offset, int length) {
+      return 0;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory b/artemis-protocols/artemis-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory
index 2cd27f4..93b9dfa 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/resources/META-INF/services/org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory
@@ -1 +1 @@
-org.apache.activemq.artemis.core.protocol.proton.ProtonProtocolManagerFactory
\ No newline at end of file
+org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManagerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
deleted file mode 100644
index fc77c7d..0000000
--- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
+++ /dev/null
@@ -1,793 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.core.protocol.proton;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.PooledByteBufAllocator;
-import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
-import org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSObjectMessage;
-import org.apache.activemq.artemis.core.protocol.proton.converter.message.EncodedMessage;
-import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
-import org.apache.blacklist.ABadClass;
-import org.apache.qpid.proton.amqp.Binary;
-import org.apache.qpid.proton.amqp.messaging.AmqpSequence;
-import org.apache.qpid.proton.amqp.messaging.AmqpValue;
-import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
-import org.apache.qpid.proton.amqp.messaging.Data;
-import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.message.ProtonJMessage;
-import org.apache.qpid.proton.message.impl.MessageImpl;
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.core.journal.EncodingSupport;
-import org.apache.activemq.artemis.core.protocol.proton.converter.ProtonMessageConverter;
-import org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSBytesMessage;
-import org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSMapMessage;
-import org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSMessage;
-import org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSStreamMessage;
-import org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSTextMessage;
-import org.apache.activemq.artemis.core.server.ServerMessage;
-import org.apache.activemq.artemis.utils.SimpleIDGenerator;
-import org.junit.Assert;
-import org.junit.Test;
-import org.proton.plug.util.NettyWritable;
-
-public class TestConversions extends Assert {
-
-   @Test
-   public void testObjectMessageWhiteList() throws Exception {
-      Map<String, Object> mapprop = createPropertiesMap();
-      ApplicationProperties properties = new ApplicationProperties(mapprop);
-      MessageImpl message = (MessageImpl) Message.Factory.create();
-      message.setApplicationProperties(properties);
-
-      byte[] bodyBytes = new byte[4];
-
-      for (int i = 0; i < bodyBytes.length; i++) {
-         bodyBytes[i] = (byte) 0xff;
-      }
-
-      message.setBody(new AmqpValue(new Boolean(true)));
-
-      EncodedMessage encodedMessage = encodeMessage(message);
-
-      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
-      ServerJMSObjectMessage serverMessage = (ServerJMSObjectMessage) converter.inboundJMSType(encodedMessage);
-
-      verifyProperties(serverMessage);
-
-      assertEquals(true, serverMessage.getObject());
-
-      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
-
-      AmqpValue value = (AmqpValue) ((Message)obj).getBody();
-      assertEquals(value.getValue(), true);
-
-   }
-
-   @Test
-   public void testObjectMessageNotOnWhiteList() throws Exception {
-
-
-      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
-      ServerMessageImpl message = new ServerMessageImpl(1, 1024);
-      message.setType((byte) 2);
-      ServerJMSObjectMessage serverMessage = new ServerJMSObjectMessage(message, 1024);
-      ByteArrayOutputStream out = new ByteArrayOutputStream();
-      ObjectOutputStream ois = new ObjectOutputStream(out);
-      ois.writeObject(new ABadClass());
-      serverMessage.getInnerMessage().getBodyBuffer().writeBytes(out.toByteArray());
-
-      try {
-         converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
-         fail("should throw ClassNotFoundException");
-      }
-      catch (ClassNotFoundException e) {
-         //ignore
-      }
-   }
-
-
-   @Test
-   public void testSimpleConversionBytes() throws Exception {
-      Map<String, Object> mapprop = createPropertiesMap();
-      ApplicationProperties properties = new ApplicationProperties(mapprop);
-      MessageImpl message = (MessageImpl) Message.Factory.create();
-      message.setApplicationProperties(properties);
-
-      byte[] bodyBytes = new byte[4];
-
-      for (int i = 0; i < bodyBytes.length; i++) {
-         bodyBytes[i] = (byte) 0xff;
-      }
-
-      message.setBody(new Data(new Binary(bodyBytes)));
-
-      EncodedMessage encodedMessage = encodeMessage(message);
-
-      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
-      ServerJMSBytesMessage serverMessage = (ServerJMSBytesMessage) converter.inboundJMSType(encodedMessage);
-
-      verifyProperties(serverMessage);
-
-      assertEquals(bodyBytes.length, serverMessage.getBodyLength());
-
-      byte[] newBodyBytes = new byte[4];
-
-      serverMessage.readBytes(newBodyBytes);
-
-      Assert.assertArrayEquals(bodyBytes, newBodyBytes);
-
-      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
-
-      System.out.println("output = " + obj);
-
-   }
-
-   private void verifyProperties(javax.jms.Message message) throws Exception {
-      assertEquals(true, message.getBooleanProperty("true"));
-      assertEquals(false, message.getBooleanProperty("false"));
-      assertEquals("bar", message.getStringProperty("foo"));
-   }
-
-   private Map<String, Object> createPropertiesMap() {
-      Map<String, Object> mapprop = new HashMap<>();
-
-      mapprop.put("true", Boolean.TRUE);
-      mapprop.put("false", Boolean.FALSE);
-      mapprop.put("foo", "bar");
-      return mapprop;
-   }
-
-   @Test
-   public void testSimpleConversionMap() throws Exception {
-      Map<String, Object> mapprop = createPropertiesMap();
-      ApplicationProperties properties = new ApplicationProperties(mapprop);
-      MessageImpl message = (MessageImpl) Message.Factory.create();
-      message.setApplicationProperties(properties);
-
-      Map<String, Object> mapValues = new HashMap<>();
-      mapValues.put("somestr", "value");
-      mapValues.put("someint", Integer.valueOf(1));
-
-      message.setBody(new AmqpValue(mapValues));
-
-      EncodedMessage encodedMessage = encodeMessage(message);
-
-      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
-      ServerJMSMapMessage serverMessage = (ServerJMSMapMessage) converter.inboundJMSType(encodedMessage);
-
-      verifyProperties(serverMessage);
-
-      Assert.assertEquals(1, serverMessage.getInt("someint"));
-      Assert.assertEquals("value", serverMessage.getString("somestr"));
-
-      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
-
-      reEncodeMsg(obj);
-
-      MessageImpl outMessage = (MessageImpl) obj;
-      AmqpValue value = (AmqpValue) outMessage.getBody();
-      Map mapoutput = (Map) value.getValue();
-
-      assertEquals(Integer.valueOf(1), mapoutput.get("someint"));
-
-      System.out.println("output = " + obj);
-
-   }
-
-   @Test
-   public void testSimpleConversionStream() throws Exception {
-      Map<String, Object> mapprop = createPropertiesMap();
-      ApplicationProperties properties = new ApplicationProperties(mapprop);
-      MessageImpl message = (MessageImpl) Message.Factory.create();
-      message.setApplicationProperties(properties);
-
-      List<Object> objects = new LinkedList<>();
-      objects.add(new Integer(10));
-      objects.add("10");
-
-      message.setBody(new AmqpSequence(objects));
-
-      EncodedMessage encodedMessage = encodeMessage(message);
-
-      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
-      ServerJMSStreamMessage serverMessage = (ServerJMSStreamMessage) converter.inboundJMSType(encodedMessage);
-
-      simulatePersistence(serverMessage);
-
-      verifyProperties(serverMessage);
-
-      serverMessage.reset();
-
-      assertEquals(10, serverMessage.readInt());
-      assertEquals("10", serverMessage.readString());
-
-      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
-
-      reEncodeMsg(obj);
-
-      MessageImpl outMessage = (MessageImpl) obj;
-      List list = ((AmqpSequence) outMessage.getBody()).getValue();
-      Assert.assertEquals(Integer.valueOf(10), list.get(0));
-      Assert.assertEquals("10", list.get(1));
-
-   }
-
-   @Test
-   public void testSimpleConversionText() throws Exception {
-      Map<String, Object> mapprop = createPropertiesMap();
-      ApplicationProperties properties = new ApplicationProperties(mapprop);
-      MessageImpl message = (MessageImpl) Message.Factory.create();
-      message.setApplicationProperties(properties);
-
-      String text = "someText";
-      message.setBody(new AmqpValue(text));
-
-      EncodedMessage encodedMessage = encodeMessage(message);
-
-      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
-      ServerJMSTextMessage serverMessage = (ServerJMSTextMessage) converter.inboundJMSType(encodedMessage);
-
-      simulatePersistence(serverMessage);
-
-      verifyProperties(serverMessage);
-
-      Assert.assertEquals(text, serverMessage.getText());
-
-      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
-
-      reEncodeMsg(obj);
-
-      MessageImpl outMessage = (MessageImpl) obj;
-      AmqpValue value = (AmqpValue) outMessage.getBody();
-      String textValue = (String) value.getValue();
-
-      Assert.assertEquals(text, textValue);
-
-      System.out.println("output = " + obj);
-
-   }
-
-   private void simulatePersistence(ServerJMSMessage serverMessage) {
-      serverMessage.getInnerMessage().setAddress(new SimpleString("jms.queue.SomeAddress"));
-      // This is just to simulate what would happen during the persistence of the message
-      // We need to still be able to recover the message when we read it back
-      ((EncodingSupport) serverMessage.getInnerMessage()).encode(new EmptyBuffer());
-   }
-
-   private ProtonJMessage reEncodeMsg(Object obj) {
-      ProtonJMessage objOut = (ProtonJMessage) obj;
-
-      ByteBuf nettyBuffer = PooledByteBufAllocator.DEFAULT.heapBuffer(1024);
-
-      objOut.encode(new NettyWritable(nettyBuffer));
-      return objOut;
-   }
-
-   private EncodedMessage encodeMessage(MessageImpl message) {
-      ByteBuf buf = PooledByteBufAllocator.DEFAULT.heapBuffer(1024 * 1024);
-      message.encode(new NettyWritable(buf));
-      byte[] bytesConvert = new byte[buf.writerIndex()];
-      buf.readBytes(bytesConvert);
-      return new EncodedMessage(0, bytesConvert, 0, bytesConvert.length);
-   }
-
-   class EmptyBuffer implements ActiveMQBuffer {
-
-      @Override
-      public ByteBuf byteBuf() {
-         return null;
-      }
-
-      @Override
-      public int capacity() {
-         return 0;
-      }
-
-      @Override
-      public int readerIndex() {
-         return 0;
-      }
-
-      @Override
-      public void readerIndex(int readerIndex) {
-
-      }
-
-      @Override
-      public int writerIndex() {
-         return 0;
-      }
-
-      @Override
-      public void writerIndex(int writerIndex) {
-
-      }
-
-      @Override
-      public void setIndex(int readerIndex, int writerIndex) {
-
-      }
-
-      @Override
-      public int readableBytes() {
-         return 0;
-      }
-
-      @Override
-      public int writableBytes() {
-         return 0;
-      }
-
-      @Override
-      public boolean readable() {
-         return false;
-      }
-
-      @Override
-      public boolean writable() {
-         return false;
-      }
-
-      @Override
-      public void clear() {
-
-      }
-
-      @Override
-      public void markReaderIndex() {
-
-      }
-
-      @Override
-      public void resetReaderIndex() {
-
-      }
-
-      @Override
-      public void markWriterIndex() {
-
-      }
-
-      @Override
-      public void resetWriterIndex() {
-
-      }
-
-      @Override
-      public void discardReadBytes() {
-
-      }
-
-      @Override
-      public byte getByte(int index) {
-         return 0;
-      }
-
-      @Override
-      public short getUnsignedByte(int index) {
-         return 0;
-      }
-
-      @Override
-      public short getShort(int index) {
-         return 0;
-      }
-
-      @Override
-      public int getUnsignedShort(int index) {
-         return 0;
-      }
-
-      @Override
-      public int getInt(int index) {
-         return 0;
-      }
-
-      @Override
-      public long getUnsignedInt(int index) {
-         return 0;
-      }
-
-      @Override
-      public long getLong(int index) {
-         return 0;
-      }
-
-      @Override
-      public void getBytes(int index, ActiveMQBuffer dst) {
-
-      }
-
-      @Override
-      public void getBytes(int index, ActiveMQBuffer dst, int length) {
-
-      }
-
-      @Override
-      public void getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length) {
-
-      }
-
-      @Override
-      public void getBytes(int index, byte[] dst) {
-
-      }
-
-      @Override
-      public void getBytes(int index, byte[] dst, int dstIndex, int length) {
-
-      }
-
-      @Override
-      public void getBytes(int index, ByteBuffer dst) {
-
-      }
-
-      @Override
-      public char getChar(int index) {
-         return 0;
-      }
-
-      @Override
-      public float getFloat(int index) {
-         return 0;
-      }
-
-      @Override
-      public double getDouble(int index) {
-         return 0;
-      }
-
-      @Override
-      public void setByte(int index, byte value) {
-
-      }
-
-      @Override
-      public void setShort(int index, short value) {
-
-      }
-
-      @Override
-      public void setInt(int index, int value) {
-
-      }
-
-      @Override
-      public void setLong(int index, long value) {
-
-      }
-
-      @Override
-      public void setBytes(int index, ActiveMQBuffer src) {
-
-      }
-
-      @Override
-      public void setBytes(int index, ActiveMQBuffer src, int length) {
-
-      }
-
-      @Override
-      public void setBytes(int index, ActiveMQBuffer src, int srcIndex, int length) {
-
-      }
-
-      @Override
-      public void setBytes(int index, byte[] src) {
-
-      }
-
-      @Override
-      public void setBytes(int index, byte[] src, int srcIndex, int length) {
-
-      }
-
-      @Override
-      public void setBytes(int index, ByteBuffer src) {
-
-      }
-
-      @Override
-      public void setChar(int index, char value) {
-
-      }
-
-      @Override
-      public void setFloat(int index, float value) {
-
-      }
-
-      @Override
-      public void setDouble(int index, double value) {
-
-      }
-
-      @Override
-      public byte readByte() {
-         return 0;
-      }
-
-      @Override
-      public int readUnsignedByte() {
-         return 0;
-      }
-
-      @Override
-      public short readShort() {
-         return 0;
-      }
-
-      @Override
-      public int readUnsignedShort() {
-         return 0;
-      }
-
-      @Override
-      public int readInt() {
-         return 0;
-      }
-
-      @Override
-      public long readUnsignedInt() {
-         return 0;
-      }
-
-      @Override
-      public long readLong() {
-         return 0;
-      }
-
-      @Override
-      public char readChar() {
-         return 0;
-      }
-
-      @Override
-      public float readFloat() {
-         return 0;
-      }
-
-      @Override
-      public double readDouble() {
-         return 0;
-      }
-
-      @Override
-      public boolean readBoolean() {
-         return false;
-      }
-
-      @Override
-      public SimpleString readNullableSimpleString() {
-         return null;
-      }
-
-      @Override
-      public String readNullableString() {
-         return null;
-      }
-
-      @Override
-      public SimpleString readSimpleString() {
-         return null;
-      }
-
-      @Override
-      public String readString() {
-         return null;
-      }
-
-      @Override
-      public String readUTF() {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer readBytes(int length) {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer readSlice(int length) {
-         return null;
-      }
-
-      @Override
-      public void readBytes(ActiveMQBuffer dst) {
-
-      }
-
-      @Override
-      public void readBytes(ActiveMQBuffer dst, int length) {
-
-      }
-
-      @Override
-      public void readBytes(ActiveMQBuffer dst, int dstIndex, int length) {
-
-      }
-
-      @Override
-      public void readBytes(byte[] dst) {
-
-      }
-
-      @Override
-      public void readBytes(byte[] dst, int dstIndex, int length) {
-
-      }
-
-      @Override
-      public void readBytes(ByteBuffer dst) {
-
-      }
-
-      @Override
-      public int skipBytes(int length) {
-         return length;
-      }
-
-      @Override
-      public void writeByte(byte value) {
-
-      }
-
-      @Override
-      public void writeShort(short value) {
-
-      }
-
-      @Override
-      public void writeInt(int value) {
-
-      }
-
-      @Override
-      public void writeLong(long value) {
-
-      }
-
-      @Override
-      public void writeChar(char chr) {
-
-      }
-
-      @Override
-      public void writeFloat(float value) {
-
-      }
-
-      @Override
-      public void writeDouble(double value) {
-
-      }
-
-      @Override
-      public void writeBoolean(boolean val) {
-
-      }
-
-      @Override
-      public void writeNullableSimpleString(SimpleString val) {
-
-      }
-
-      @Override
-      public void writeNullableString(String val) {
-
-      }
-
-      @Override
-      public void writeSimpleString(SimpleString val) {
-
-      }
-
-      @Override
-      public void writeString(String val) {
-
-      }
-
-      @Override
-      public void writeUTF(String utf) {
-
-      }
-
-      @Override
-      public void writeBytes(ActiveMQBuffer src, int length) {
-
-      }
-
-      @Override
-      public void writeBytes(ActiveMQBuffer src, int srcIndex, int length) {
-
-      }
-
-      @Override
-      public void writeBytes(byte[] src) {
-
-      }
-
-      @Override
-      public void writeBytes(byte[] src, int srcIndex, int length) {
-
-      }
-
-      @Override
-      public void writeBytes(ByteBuffer src) {
-
-      }
-
-      @Override
-      public void readFully(byte[] b) throws IOException {
-      }
-
-      @Override
-      public void readFully(byte[] b, int off, int len) throws IOException {
-      }
-
-      @Override
-      public String readLine() throws IOException {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer copy() {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer copy(int index, int length) {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer slice() {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer slice(int index, int length) {
-         return null;
-      }
-
-      @Override
-      public ActiveMQBuffer duplicate() {
-         return null;
-      }
-
-      @Override
-      public ByteBuffer toByteBuffer() {
-         return null;
-      }
-
-      @Override
-      public ByteBuffer toByteBuffer(int index, int length) {
-         return null;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java
new file mode 100644
index 0000000..19524b0
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java
@@ -0,0 +1,792 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.converter;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.PooledByteBufAllocator;
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSMapMessage;
+import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage;
+import org.apache.activemq.artemis.protocol.amqp.converter.message.EncodedMessage;
+import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
+import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSBytesMessage;
+import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSStreamMessage;
+import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSTextMessage;
+import org.apache.blacklist.ABadClass;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.messaging.AmqpSequence;
+import org.apache.qpid.proton.amqp.messaging.AmqpValue;
+import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
+import org.apache.qpid.proton.amqp.messaging.Data;
+import org.apache.qpid.proton.message.Message;
+import org.apache.qpid.proton.message.ProtonJMessage;
+import org.apache.qpid.proton.message.impl.MessageImpl;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.journal.EncodingSupport;
+import org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSMessage;
+import org.apache.activemq.artemis.core.server.ServerMessage;
+import org.apache.activemq.artemis.utils.SimpleIDGenerator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.activemq.artemis.protocol.amqp.util.NettyWritable;
+
+public class TestConversions extends Assert {
+
+   @Test
+   public void testObjectMessageWhiteList() throws Exception {
+      Map<String, Object> mapprop = createPropertiesMap();
+      ApplicationProperties properties = new ApplicationProperties(mapprop);
+      MessageImpl message = (MessageImpl) Message.Factory.create();
+      message.setApplicationProperties(properties);
+
+      byte[] bodyBytes = new byte[4];
+
+      for (int i = 0; i < bodyBytes.length; i++) {
+         bodyBytes[i] = (byte) 0xff;
+      }
+
+      message.setBody(new AmqpValue(new Boolean(true)));
+
+      EncodedMessage encodedMessage = encodeMessage(message);
+
+      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
+      ServerJMSObjectMessage serverMessage = (ServerJMSObjectMessage) converter.inboundJMSType(encodedMessage);
+
+      verifyProperties(serverMessage);
+
+      assertEquals(true, serverMessage.getObject());
+
+      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
+
+      AmqpValue value = (AmqpValue) ((Message)obj).getBody();
+      assertEquals(value.getValue(), true);
+
+   }
+
+   @Test
+   public void testObjectMessageNotOnWhiteList() throws Exception {
+
+
+      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
+      ServerMessageImpl message = new ServerMessageImpl(1, 1024);
+      message.setType((byte) 2);
+      ServerJMSObjectMessage serverMessage = new ServerJMSObjectMessage(message, 1024);
+      ByteArrayOutputStream out = new ByteArrayOutputStream();
+      ObjectOutputStream ois = new ObjectOutputStream(out);
+      ois.writeObject(new ABadClass());
+      serverMessage.getInnerMessage().getBodyBuffer().writeBytes(out.toByteArray());
+
+      try {
+         converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
+         fail("should throw ClassNotFoundException");
+      }
+      catch (ClassNotFoundException e) {
+         //ignore
+      }
+   }
+
+
+   @Test
+   public void testSimpleConversionBytes() throws Exception {
+      Map<String, Object> mapprop = createPropertiesMap();
+      ApplicationProperties properties = new ApplicationProperties(mapprop);
+      MessageImpl message = (MessageImpl) Message.Factory.create();
+      message.setApplicationProperties(properties);
+
+      byte[] bodyBytes = new byte[4];
+
+      for (int i = 0; i < bodyBytes.length; i++) {
+         bodyBytes[i] = (byte) 0xff;
+      }
+
+      message.setBody(new Data(new Binary(bodyBytes)));
+
+      EncodedMessage encodedMessage = encodeMessage(message);
+
+      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
+      ServerJMSBytesMessage serverMessage = (ServerJMSBytesMessage) converter.inboundJMSType(encodedMessage);
+
+      verifyProperties(serverMessage);
+
+      assertEquals(bodyBytes.length, serverMessage.getBodyLength());
+
+      byte[] newBodyBytes = new byte[4];
+
+      serverMessage.readBytes(newBodyBytes);
+
+      Assert.assertArrayEquals(bodyBytes, newBodyBytes);
+
+      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
+
+      System.out.println("output = " + obj);
+
+   }
+
+   private void verifyProperties(javax.jms.Message message) throws Exception {
+      assertEquals(true, message.getBooleanProperty("true"));
+      assertEquals(false, message.getBooleanProperty("false"));
+      assertEquals("bar", message.getStringProperty("foo"));
+   }
+
+   private Map<String, Object> createPropertiesMap() {
+      Map<String, Object> mapprop = new HashMap<>();
+
+      mapprop.put("true", Boolean.TRUE);
+      mapprop.put("false", Boolean.FALSE);
+      mapprop.put("foo", "bar");
+      return mapprop;
+   }
+
+   @Test
+   public void testSimpleConversionMap() throws Exception {
+      Map<String, Object> mapprop = createPropertiesMap();
+      ApplicationProperties properties = new ApplicationProperties(mapprop);
+      MessageImpl message = (MessageImpl) Message.Factory.create();
+      message.setApplicationProperties(properties);
+
+      Map<String, Object> mapValues = new HashMap<>();
+      mapValues.put("somestr", "value");
+      mapValues.put("someint", Integer.valueOf(1));
+
+      message.setBody(new AmqpValue(mapValues));
+
+      EncodedMessage encodedMessage = encodeMessage(message);
+
+      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
+      ServerJMSMapMessage serverMessage = (ServerJMSMapMessage) converter.inboundJMSType(encodedMessage);
+
+      verifyProperties(serverMessage);
+
+      Assert.assertEquals(1, serverMessage.getInt("someint"));
+      Assert.assertEquals("value", serverMessage.getString("somestr"));
+
+      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
+
+      reEncodeMsg(obj);
+
+      MessageImpl outMessage = (MessageImpl) obj;
+      AmqpValue value = (AmqpValue) outMessage.getBody();
+      Map mapoutput = (Map) value.getValue();
+
+      assertEquals(Integer.valueOf(1), mapoutput.get("someint"));
+
+      System.out.println("output = " + obj);
+
+   }
+
+   @Test
+   public void testSimpleConversionStream() throws Exception {
+      Map<String, Object> mapprop = createPropertiesMap();
+      ApplicationProperties properties = new ApplicationProperties(mapprop);
+      MessageImpl message = (MessageImpl) Message.Factory.create();
+      message.setApplicationProperties(properties);
+
+      List<Object> objects = new LinkedList<>();
+      objects.add(new Integer(10));
+      objects.add("10");
+
+      message.setBody(new AmqpSequence(objects));
+
+      EncodedMessage encodedMessage = encodeMessage(message);
+
+      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
+      ServerJMSStreamMessage serverMessage = (ServerJMSStreamMessage) converter.inboundJMSType(encodedMessage);
+
+      simulatePersistence(serverMessage);
+
+      verifyProperties(serverMessage);
+
+      serverMessage.reset();
+
+      assertEquals(10, serverMessage.readInt());
+      assertEquals("10", serverMessage.readString());
+
+      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
+
+      reEncodeMsg(obj);
+
+      MessageImpl outMessage = (MessageImpl) obj;
+      List list = ((AmqpSequence) outMessage.getBody()).getValue();
+      Assert.assertEquals(Integer.valueOf(10), list.get(0));
+      Assert.assertEquals("10", list.get(1));
+
+   }
+
+   @Test
+   public void testSimpleConversionText() throws Exception {
+      Map<String, Object> mapprop = createPropertiesMap();
+      ApplicationProperties properties = new ApplicationProperties(mapprop);
+      MessageImpl message = (MessageImpl) Message.Factory.create();
+      message.setApplicationProperties(properties);
+
+      String text = "someText";
+      message.setBody(new AmqpValue(text));
+
+      EncodedMessage encodedMessage = encodeMessage(message);
+
+      ProtonMessageConverter converter = new ProtonMessageConverter(new SimpleIDGenerator(0));
+      ServerJMSTextMessage serverMessage = (ServerJMSTextMessage) converter.inboundJMSType(encodedMessage);
+
+      simulatePersistence(serverMessage);
+
+      verifyProperties(serverMessage);
+
+      Assert.assertEquals(text, serverMessage.getText());
+
+      Object obj = converter.outbound((ServerMessage) serverMessage.getInnerMessage(), 0);
+
+      reEncodeMsg(obj);
+
+      MessageImpl outMessage = (MessageImpl) obj;
+      AmqpValue value = (AmqpValue) outMessage.getBody();
+      String textValue = (String) value.getValue();
+
+      Assert.assertEquals(text, textValue);
+
+      System.out.println("output = " + obj);
+
+   }
+
+   private void simulatePersistence(ServerJMSMessage serverMessage) {
+      serverMessage.getInnerMessage().setAddress(new SimpleString("jms.queue.SomeAddress"));
+      // This is just to simulate what would happen during the persistence of the message
+      // We need to still be able to recover the message when we read it back
+      ((EncodingSupport) serverMessage.getInnerMessage()).encode(new EmptyBuffer());
+   }
+
+   private ProtonJMessage reEncodeMsg(Object obj) {
+      ProtonJMessage objOut = (ProtonJMessage) obj;
+
+      ByteBuf nettyBuffer = PooledByteBufAllocator.DEFAULT.heapBuffer(1024);
+
+      objOut.encode(new NettyWritable(nettyBuffer));
+      return objOut;
+   }
+
+   private EncodedMessage encodeMessage(MessageImpl message) {
+      ByteBuf buf = PooledByteBufAllocator.DEFAULT.heapBuffer(1024 * 1024);
+      message.encode(new NettyWritable(buf));
+      byte[] bytesConvert = new byte[buf.writerIndex()];
+      buf.readBytes(bytesConvert);
+      return new EncodedMessage(0, bytesConvert, 0, bytesConvert.length);
+   }
+
+   class EmptyBuffer implements ActiveMQBuffer {
+
+      @Override
+      public ByteBuf byteBuf() {
+         return null;
+      }
+
+      @Override
+      public int capacity() {
+         return 0;
+      }
+
+      @Override
+      public int readerIndex() {
+         return 0;
+      }
+
+      @Override
+      public void readerIndex(int readerIndex) {
+
+      }
+
+      @Override
+      public int writerIndex() {
+         return 0;
+      }
+
+      @Override
+      public void writerIndex(int writerIndex) {
+
+      }
+
+      @Override
+      public void setIndex(int readerIndex, int writerIndex) {
+
+      }
+
+      @Override
+      public int readableBytes() {
+         return 0;
+      }
+
+      @Override
+      public int writableBytes() {
+         return 0;
+      }
+
+      @Override
+      public boolean readable() {
+         return false;
+      }
+
+      @Override
+      public boolean writable() {
+         return false;
+      }
+
+      @Override
+      public void clear() {
+
+      }
+
+      @Override
+      public void markReaderIndex() {
+
+      }
+
+      @Override
+      public void resetReaderIndex() {
+
+      }
+
+      @Override
+      public void markWriterIndex() {
+
+      }
+
+      @Override
+      public void resetWriterIndex() {
+
+      }
+
+      @Override
+      public void discardReadBytes() {
+
+      }
+
+      @Override
+      public byte getByte(int index) {
+         return 0;
+      }
+
+      @Override
+      public short getUnsignedByte(int index) {
+         return 0;
+      }
+
+      @Override
+      public short getShort(int index) {
+         return 0;
+      }
+
+      @Override
+      public int getUnsignedShort(int index) {
+         return 0;
+      }
+
+      @Override
+      public int getInt(int index) {
+         return 0;
+      }
+
+      @Override
+      public long getUnsignedInt(int index) {
+         return 0;
+      }
+
+      @Override
+      public long getLong(int index) {
+         return 0;
+      }
+
+      @Override
+      public void getBytes(int index, ActiveMQBuffer dst) {
+
+      }
+
+      @Override
+      public void getBytes(int index, ActiveMQBuffer dst, int length) {
+
+      }
+
+      @Override
+      public void getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length) {
+
+      }
+
+      @Override
+      public void getBytes(int index, byte[] dst) {
+
+      }
+
+      @Override
+      public void getBytes(int index, byte[] dst, int dstIndex, int length) {
+
+      }
+
+      @Override
+      public void getBytes(int index, ByteBuffer dst) {
+
+      }
+
+      @Override
+      public char getChar(int index) {
+         return 0;
+      }
+
+      @Override
+      public float getFloat(int index) {
+         return 0;
+      }
+
+      @Override
+      public double getDouble(int index) {
+         return 0;
+      }
+
+      @Override
+      public void setByte(int index, byte value) {
+
+      }
+
+      @Override
+      public void setShort(int index, short value) {
+
+      }
+
+      @Override
+      public void setInt(int index, int value) {
+
+      }
+
+      @Override
+      public void setLong(int index, long value) {
+
+      }
+
+      @Override
+      public void setBytes(int index, ActiveMQBuffer src) {
+
+      }
+
+      @Override
+      public void setBytes(int index, ActiveMQBuffer src, int length) {
+
+      }
+
+      @Override
+      public void setBytes(int index, ActiveMQBuffer src, int srcIndex, int length) {
+
+      }
+
+      @Override
+      public void setBytes(int index, byte[] src) {
+
+      }
+
+      @Override
+      public void setBytes(int index, byte[] src, int srcIndex, int length) {
+
+      }
+
+      @Override
+      public void setBytes(int index, ByteBuffer src) {
+
+      }
+
+      @Override
+      public void setChar(int index, char value) {
+
+      }
+
+      @Override
+      public void setFloat(int index, float value) {
+
+      }
+
+      @Override
+      public void setDouble(int index, double value) {
+
+      }
+
+      @Override
+      public byte readByte() {
+         return 0;
+      }
+
+      @Override
+      public int readUnsignedByte() {
+         return 0;
+      }
+
+      @Override
+      public short readShort() {
+         return 0;
+      }
+
+      @Override
+      public int readUnsignedShort() {
+         return 0;
+      }
+
+      @Override
+      public int readInt() {
+         return 0;
+      }
+
+      @Override
+      public long readUnsignedInt() {
+         return 0;
+      }
+
+      @Override
+      public long readLong() {
+         return 0;
+      }
+
+      @Override
+      public char readChar() {
+         return 0;
+      }
+
+      @Override
+      public float readFloat() {
+         return 0;
+      }
+
+      @Override
+      public double readDouble() {
+         return 0;
+      }
+
+      @Override
+      public boolean readBoolean() {
+         return false;
+      }
+
+      @Override
+      public SimpleString readNullableSimpleString() {
+         return null;
+      }
+
+      @Override
+      public String readNullableString() {
+         return null;
+      }
+
+      @Override
+      public SimpleString readSimpleString() {
+         return null;
+      }
+
+      @Override
+      public String readString() {
+         return null;
+      }
+
+      @Override
+      public String readUTF() {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer readBytes(int length) {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer readSlice(int length) {
+         return null;
+      }
+
+      @Override
+      public void readBytes(ActiveMQBuffer dst) {
+
+      }
+
+      @Override
+      public void readBytes(ActiveMQBuffer dst, int length) {
+
+      }
+
+      @Override
+      public void readBytes(ActiveMQBuffer dst, int dstIndex, int length) {
+
+      }
+
+      @Override
+      public void readBytes(byte[] dst) {
+
+      }
+
+      @Override
+      public void readBytes(byte[] dst, int dstIndex, int length) {
+
+      }
+
+      @Override
+      public void readBytes(ByteBuffer dst) {
+
+      }
+
+      @Override
+      public int skipBytes(int length) {
+         return length;
+      }
+
+      @Override
+      public void writeByte(byte value) {
+
+      }
+
+      @Override
+      public void writeShort(short value) {
+
+      }
+
+      @Override
+      public void writeInt(int value) {
+
+      }
+
+      @Override
+      public void writeLong(long value) {
+
+      }
+
+      @Override
+      public void writeChar(char chr) {
+
+      }
+
+      @Override
+      public void writeFloat(float value) {
+
+      }
+
+      @Override
+      public void writeDouble(double value) {
+
+      }
+
+      @Override
+      public void writeBoolean(boolean val) {
+
+      }
+
+      @Override
+      public void writeNullableSimpleString(SimpleString val) {
+
+      }
+
+      @Override
+      public void writeNullableString(String val) {
+
+      }
+
+      @Override
+      public void writeSimpleString(SimpleString val) {
+
+      }
+
+      @Override
+      public void writeString(String val) {
+
+      }
+
+      @Override
+      public void writeUTF(String utf) {
+
+      }
+
+      @Override
+      public void writeBytes(ActiveMQBuffer src, int length) {
+
+      }
+
+      @Override
+      public void writeBytes(ActiveMQBuffer src, int srcIndex, int length) {
+
+      }
+
+      @Override
+      public void writeBytes(byte[] src) {
+
+      }
+
+      @Override
+      public void writeBytes(byte[] src, int srcIndex, int length) {
+
+      }
+
+      @Override
+      public void writeBytes(ByteBuffer src) {
+
+      }
+
+      @Override
+      public void readFully(byte[] b) throws IOException {
+      }
+
+      @Override
+      public void readFully(byte[] b, int off, int len) throws IOException {
+      }
+
+      @Override
+      public String readLine() throws IOException {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer copy() {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer copy(int index, int length) {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer slice() {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer slice(int index, int length) {
+         return null;
+      }
+
+      @Override
+      public ActiveMQBuffer duplicate() {
+         return null;
+      }
+
+      @Override
+      public ByteBuffer toByteBuffer() {
+         return null;
+      }
+
+      @Override
+      public ByteBuffer toByteBuffer(int index, int length) {
+         return null;
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/ClientSASLPlain.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/ClientSASLPlain.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/ClientSASLPlain.java
new file mode 100644
index 0000000..0e9d0d4
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/ClientSASLPlain.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.sasl;
+
+/**
+ * This will generate what a client would generate for bytes on Plain sasl. Used on test
+ */
+public class ClientSASLPlain  {
+
+   private String username;
+   private String password;
+
+   public ClientSASLPlain(String user, String password) {
+      this.username = user;
+      this.password = password;
+   }
+
+   public String getName() {
+      return "PLAIN";
+   }
+
+   public byte[] getBytes() {
+
+      if (username == null) {
+         username = "";
+      }
+
+      if (password == null) {
+         password = "";
+      }
+
+      byte[] usernameBytes = username.getBytes();
+      byte[] passwordBytes = password.getBytes();
+      byte[] data = new byte[usernameBytes.length + passwordBytes.length + 2];
+      System.arraycopy(usernameBytes, 0, data, 1, usernameBytes.length);
+      System.arraycopy(passwordBytes, 0, data, 2 + usernameBytes.length, passwordBytes.length);
+      return data;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/PlainSASLTest.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/PlainSASLTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/PlainSASLTest.java
new file mode 100644
index 0000000..d259de2
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/PlainSASLTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.sasl;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class PlainSASLTest {
+
+   @Test
+   public void testPlain() {
+      ClientSASLPlain plainSASL = new ClientSASLPlain("user-me", "password-secret");
+      byte[] bytesResult = plainSASL.getBytes();
+
+      ServerSASLPlain serverSASLPlain = new ServerSASLPlain();
+      PlainSASLResult result = (PlainSASLResult) serverSASLPlain.processSASL(bytesResult);
+      Assert.assertEquals("user-me", result.getUser());
+      Assert.assertEquals("password-secret", result.getPassword());
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/util/CreditsSemaphoreTest.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/util/CreditsSemaphoreTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/util/CreditsSemaphoreTest.java
new file mode 100644
index 0000000..c608b85
--- /dev/null
+++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/util/CreditsSemaphoreTest.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.protocol.amqp.util;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CreditsSemaphoreTest {
+
+   final CreditsSemaphore semaphore = new CreditsSemaphore(10);
+
+   final AtomicInteger errors = new AtomicInteger(0);
+
+   final AtomicInteger acquired = new AtomicInteger(0);
+
+   final CountDownLatch waiting = new CountDownLatch(1);
+
+   Thread thread = new Thread() {
+      @Override
+      public void run() {
+         try {
+            for (int i = 0; i < 12; i++) {
+               if (!semaphore.tryAcquire()) {
+                  waiting.countDown();
+                  semaphore.acquire();
+               }
+               acquired.incrementAndGet();
+            }
+         }
+         catch (Throwable e) {
+            e.printStackTrace();
+            errors.incrementAndGet();
+         }
+      }
+   };
+
+   @Test
+   public void testSetAndRelease() throws Exception {
+      thread.start();
+
+      // 5 seconds would be an eternity here
+      Assert.assertTrue(waiting.await(5, TimeUnit.SECONDS));
+
+      Assert.assertEquals(0, semaphore.getCredits());
+
+      long timeout = System.currentTimeMillis() + 1000;
+      while (!semaphore.hasQueuedThreads() && System.currentTimeMillis() < timeout) {
+         Thread.sleep(10);
+      }
+
+      Assert.assertTrue(semaphore.hasQueuedThreads());
+
+      semaphore.setCredits(2);
+
+      thread.join();
+
+      Assert.assertEquals(12, acquired.get());
+
+      Assert.assertFalse(semaphore.hasQueuedThreads());
+   }
+
+   @Test
+   public void testDownAndUp() throws Exception {
+      thread.start();
+
+      // 5 seconds would be an eternity here
+      Assert.assertTrue(waiting.await(5, TimeUnit.SECONDS));
+
+      Assert.assertEquals(0, semaphore.getCredits());
+
+      long timeout = System.currentTimeMillis() + 1000;
+      while (!semaphore.hasQueuedThreads() && System.currentTimeMillis() < timeout) {
+         Thread.sleep(10);
+      }
+
+      Assert.assertTrue(semaphore.hasQueuedThreads());
+
+      semaphore.release(2);
+
+      thread.join();
+
+      Assert.assertEquals(12, acquired.get());
+
+      Assert.assertFalse(semaphore.hasQueuedThreads());
+   }
+
+   @Test
+   public void testStartedZeroedSetLater() throws Exception {
+      semaphore.setCredits(0);
+
+      thread.start();
+
+      // 5 seconds would be an eternity here
+      Assert.assertTrue(waiting.await(5, TimeUnit.SECONDS));
+
+      Assert.assertEquals(0, semaphore.getCredits());
+
+      long timeout = System.currentTimeMillis() + 1000;
+      while (!semaphore.hasQueuedThreads() && System.currentTimeMillis() < timeout) {
+         Thread.sleep(10);
+      }
+
+      Assert.assertTrue(semaphore.hasQueuedThreads());
+
+      Assert.assertEquals(0, acquired.get());
+
+      semaphore.setCredits(12);
+
+      thread.join();
+
+      Assert.assertEquals(12, acquired.get());
+
+      Assert.assertFalse(semaphore.hasQueuedThreads());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/pom.xml
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/pom.xml b/artemis-protocols/artemis-proton-plug/pom.xml
deleted file mode 100644
index 2412a43..0000000
--- a/artemis-protocols/artemis-proton-plug/pom.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-   <parent>
-      <artifactId>artemis-protocols</artifactId>
-      <groupId>org.apache.activemq</groupId>
-      <version>1.5.0-SNAPSHOT</version>
-   </parent>
-   <modelVersion>4.0.0</modelVersion>
-
-   <artifactId>artemis-proton-plug</artifactId>
-   <name>ActiveMQ Artemis Proton Protocol</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <!-- JMS Client because of some conversions that are done -->
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging-processor</artifactId>
-         <scope>provided</scope>
-         <optional>true</optional>
-      </dependency>
-
-      <!--
-          JBoss Logging
-      -->
-
-
-      <dependency>
-         <groupId>org.jboss.logmanager</groupId>
-         <artifactId>jboss-logmanager</artifactId>
-         <scope>test</scope>
-      </dependency>
-
-      <!-- this is for the log assertion -->
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
-         <version>${project.version}</version>
-         <scope>test</scope>
-      </dependency>
-
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.qpid</groupId>
-         <artifactId>proton-j</artifactId>
-      </dependency>
-
-      <dependency>
-         <groupId>org.apache.qpid</groupId>
-         <artifactId>qpid-client</artifactId>
-         <version>0.24</version>
-         <scope>test</scope>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.qpid</groupId>
-         <artifactId>qpid-jms-client</artifactId>
-         <version>0.5.0</version>
-         <scope>test</scope>
-      </dependency>
-
-
-
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-         <scope>provided</scope>
-      </dependency>
-      <dependency>
-         <groupId>junit</groupId>
-         <artifactId>junit</artifactId>
-         <scope>test</scope>
-      </dependency>
-
-
-   </dependencies>
-
-   <!-- We use the proton plug test classes in some of the Artemis Integration tests -->
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-jar-plugin</artifactId>
-            <version>2.6</version>
-            <executions>
-               <execution>
-                  <goals>
-                     <goal>test-jar</goal>
-                  </goals>
-               </execution>
-            </executions>
-         </plugin>
-      </plugins>
-   </build>
-
-   <packaging>bundle</packaging>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
deleted file mode 100644
index 1abd96f..0000000
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientConnectionContext.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.proton.plug;
-
-import org.proton.plug.exceptions.ActiveMQAMQPException;
-
-/**
- * This is valid only on a client connection.
- */
-public interface AMQPClientConnectionContext extends AMQPConnectionContext {
-
-   /**
-    * This will send an open and block for its return on AMQP protocol.
-    *
-    * @throws Exception
-    */
-   void clientOpen(ClientSASL sasl) throws Exception;
-
-   AMQPClientSessionContext createClientSession() throws ActiveMQAMQPException;
-
-   void setContainer(String containerID);
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientReceiverContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientReceiverContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientReceiverContext.java
deleted file mode 100644
index 514ee19..0000000
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientReceiverContext.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.proton.plug;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.qpid.proton.message.ProtonJMessage;
-
-public interface AMQPClientReceiverContext {
-
-   ProtonJMessage receiveMessage(int time, TimeUnit unit) throws Exception;
-
-   void flow(int credits);
-
-   void drain(int i);
-
-   int drained();
-
-   boolean isDraining();
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSenderContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSenderContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSenderContext.java
deleted file mode 100644
index 44d1056..0000000
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSenderContext.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.proton.plug;
-
-import org.apache.qpid.proton.message.ProtonJMessage;
-
-public interface AMQPClientSenderContext {
-
-   void send(ProtonJMessage message);
-
-   String getAddress();
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
deleted file mode 100644
index 44cec7c..0000000
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPClientSessionContext.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.proton.plug;
-
-import org.proton.plug.exceptions.ActiveMQAMQPException;
-
-public interface AMQPClientSessionContext extends AMQPSessionContext {
-
-   AMQPClientSenderContext createSender(String address, boolean preSettled) throws ActiveMQAMQPException;
-
-   AMQPClientSenderContext createDynamicSender(boolean preSettled) throws ActiveMQAMQPException;
-
-   AMQPClientReceiverContext createReceiver(String address) throws ActiveMQAMQPException;
-
-   AMQPClientReceiverContext createReceiver(String name, String address) throws ActiveMQAMQPException;
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionCallback.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionCallback.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionCallback.java
deleted file mode 100644
index f4ed64c..0000000
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionCallback.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.proton.plug;
-
-import io.netty.buffer.ByteBuf;
-import org.apache.activemq.artemis.core.transaction.Transaction;
-import org.apache.qpid.proton.amqp.Binary;
-import org.apache.qpid.proton.engine.Connection;
-import org.proton.plug.exceptions.ActiveMQAMQPException;
-
-public interface AMQPConnectionCallback {
-
-   void close();
-
-   /**
-    * this is called when bytes are available to be sent to the client.
-    * you have to callback {@link org.proton.plug.AMQPConnectionContext#outputDone(int)} after you're done with this buffer
-    *
-    * @param bytes
-    */
-   void onTransport(ByteBuf bytes, AMQPConnectionContext connection);
-
-   AMQPSessionCallback createSessionCallback(AMQPConnectionContext connection);
-
-   void setConnection(AMQPConnectionContext connection);
-
-   AMQPConnectionContext getConnection();
-
-   ServerSASL[] getSASLMechnisms();
-
-   boolean isSupportsAnonymous();
-
-   void sendSASLSupported();
-
-   boolean validateConnection(Connection connection, SASLResult saslResult);
-
-   Binary newTransaction();
-
-   Transaction getTransaction(Binary txid) throws ActiveMQAMQPException;
-
-   void removeTransaction(Binary txid);
-
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a838bf04/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionContext.java b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionContext.java
deleted file mode 100644
index 9123006..0000000
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/AMQPConnectionContext.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.proton.plug;
-
-import org.apache.qpid.proton.amqp.Symbol;
-
-import io.netty.buffer.ByteBuf;
-
-public interface AMQPConnectionContext {
-
-   void close();
-
-   Object getLock();
-
-   boolean checkDataReceived();
-
-   long getCreationTime();
-
-   SASLResult getSASLResult();
-
-   /**
-    * Load and return a <code>[]Symbol</code> that contains the connection capabilities
-    * offered to new connections
-    *
-    * @return the capabilities that are offered to new remote peers on connect.
-    */
-   Symbol[] getConnectionCapabilitiesOffered();
-
-   /**
-    * Even though we are currently always sending packets asynchronsouly
-    * we have a possibility to start trusting on the network flow control
-    * and always sync on the send of the packet
-    *
-    * This is for future use and should be kept returning false.
-    *
-    * We will have to do some testing before we make this return true
-    */
-   boolean isSyncOnFlush();
-
-   int capacity();
-
-   /**
-    * This is for the Remoting layer to push bytes on the AMQP Connection
-    * The buffer readerIndex should be at the latest read byte after this method is called
-    */
-   void inputBuffer(ByteBuf buffer);
-
-   void flush();
-
-   /**
-    * To be called when the bytes were sent down the stream (flushed on the socket for example)
-    *
-    * @param numberOfBytes
-    */
-   void outputDone(int numberOfBytes);
-
-}


Mime
View raw message