activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r752825 [2/2] - in /activemq/activemq-blaze/trunk/src: main/java/org/apache/activeblaze/ main/java/org/apache/activeblaze/cluster/ main/java/org/apache/activeblaze/group/ main/java/org/apache/activeblaze/impl/reliable/swp/ main/java/org/apa...
Date Thu, 12 Mar 2009 10:12:44 GMT
Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsMessageTransformation.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsMessageTransformation.java?rev=752825&r1=752824&r2=752825&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsMessageTransformation.java
(original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsMessageTransformation.java
Thu Mar 12 10:12:30 2009
@@ -17,6 +17,7 @@
 package org.apache.activeblaze.jms.message;
 
 import java.util.Enumeration;
+
 import javax.jms.BytesMessage;
 import javax.jms.Destination;
 import javax.jms.JMSException;
@@ -26,58 +27,63 @@
 import javax.jms.ObjectMessage;
 import javax.jms.StreamMessage;
 import javax.jms.TextMessage;
+
 import org.apache.activeblaze.BlazeMessage;
 import org.apache.activeblaze.jms.BlazeJmsDestination;
+
 /**
- * A helper class for converting normal JMS interfaces into ActiveMQ specific
- * ones.
+ * A helper class for converting normal JMS interfaces into ActiveMQ specific ones.
  * 
  * @version $Revision: 1.1 $
  */
-public final class BlazeJmsMessageTransformation {
+public final class BlazeJmsMessageTransformation{
     private BlazeJmsMessageTransformation() {
     }
-
+    
     /**
      * @param dest
      * @return a BlazeJmsDestination
      * @throws JMSException
      */
-    private static BlazeJmsDestination transformDestination(Destination dest) throws JMSException
{
+    private static BlazeJmsDestination transformDestination(Destination dest) throws JMSException{
         return BlazeJmsDestination.transform(dest);
     }
-
+    
     /**
      * @param message
      * @return a BlazeJmsMessage
      * @throws JMSException
      */
-    public static BlazeJmsMessage transformMessage(BlazeMessage message) throws JMSException
{
+    public static BlazeJmsMessage transformMessage(BlazeMessage message) throws JMSException{
         BlazeJmsMessage result = null;
-        int type = message.getType();
-        if (type == BlazeJmsMessage.JmsMessageType.BYTES.ordinal()) {
-            result = new BlazeJmsBytesMessage();
-        } else if (type == BlazeJmsMessage.JmsMessageType.MAP.ordinal()) {
-            result = new BlazeJmsMapMessage();
-        } else if (type == BlazeJmsMessage.JmsMessageType.OBJECT.ordinal()) {
-            result = new BlazeJmsObjectMessage();
-        } else if (type == BlazeJmsMessage.JmsMessageType.STREAM.ordinal()) {
-            result = new BlazeJmsStreamMessage();
-        } else if (type == BlazeJmsMessage.JmsMessageType.TEXT.ordinal()) {
-            result = new BlazeJmsTextMessage();
+        if (message instanceof BlazeJmsMessage) {
+            result = (BlazeJmsMessage) message;
         } else {
-            result = new BlazeJmsMessage();
+            int type = message.getType();
+            if (type == BlazeJmsMessage.JmsMessageType.BYTES.ordinal()) {
+                result = new BlazeJmsBytesMessage();
+            } else if (type == BlazeJmsMessage.JmsMessageType.MAP.ordinal()) {
+                result = new BlazeJmsMapMessage();
+            } else if (type == BlazeJmsMessage.JmsMessageType.OBJECT.ordinal()) {
+                result = new BlazeJmsObjectMessage();
+            } else if (type == BlazeJmsMessage.JmsMessageType.STREAM.ordinal()) {
+                result = new BlazeJmsStreamMessage();
+            } else if (type == BlazeJmsMessage.JmsMessageType.TEXT.ordinal()) {
+                result = new BlazeJmsTextMessage();
+            } else {
+                result = new BlazeJmsMessage();
+            }
+            result.setContent(message.getContent());
         }
-        result.setContent(message.getContent());
         return result;
     }
-
+    
     /**
      * @param message
      * @return a BlazeJmsDestination
      * @throws JMSException
      */
-    public static BlazeJmsMessage transformMessage(Message message) throws JMSException {
+    public static BlazeJmsMessage transformMessage(Message message) throws JMSException{
         if (message instanceof BlazeJmsMessage) {
             return (BlazeJmsMessage) message;
         }
@@ -137,18 +143,15 @@
         copyProperties(message, transformedMessage);
         return transformedMessage;
     }
-
+    
     /**
-     * Copies the standard JMS and user defined properties from the givem
-     * message to the specified message
+     * Copies the standard JMS and user defined properties from the givem message to the
specified message
      * 
-     * @param fromMessage
-     *            the message to take the properties from
-     * @param toMessage
-     *            the message to add the properties to
+     * @param fromMessage the message to take the properties from
+     * @param toMessage the message to add the properties to
      * @throws JMSException
      */
-    public static void copyProperties(Message fromMessage, Message toMessage) throws JMSException
{
+    public static void copyProperties(Message fromMessage,Message toMessage) throws JMSException{
         toMessage.setJMSMessageID(fromMessage.getJMSMessageID());
         toMessage.setJMSCorrelationID(fromMessage.getJMSCorrelationID());
         toMessage.setJMSReplyTo(transformDestination(fromMessage.getJMSReplyTo()));

Modified: activemq/activemq-blaze/trunk/src/main/proto/blaze.proto
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/proto/blaze.proto?rev=752825&r1=752824&r2=752825&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/proto/blaze.proto (original)
+++ activemq/activemq-blaze/trunk/src/main/proto/blaze.proto Thu Mar 12 10:12:30 2009
@@ -23,7 +23,7 @@
 // are not valid for protoc, but they are valid for the ActiveMQ proto compiler.
 // In the ActiveMQ proto compiler, comments terminate with the pipe character: |
   
-enum MessageType {
+enum MessageType{
   //| option java_create_message="true";
   BLAZE_DATA = 0;
   MEMBER_DATA = 1;
@@ -39,7 +39,7 @@
   optional bool reliable = 2;
   optional bool response = 3;
   optional bool replayed = 4;
-  optional MessageType type =5;  
+  optional MessageType messageType =5;  
   optional bytes producerId = 6;
   optional int32 sessionId = 7;
   optional int64 messageSequence = 8;  
@@ -48,24 +48,24 @@
   optional bytes payload= 11;
   optional bytes messageId =12;
   optional bytes correlationId = 13;
+  optional DestinationData destinationData = 14;  
+  optional int32 payloadType = 15;
 }
     
 message BlazeData {
   optional bool persistent = 1;
   optional int32 priority = 2;
   optional int32 redeliveryCounter = 3;
-  optional int32 type =4;
-  optional int64 timestamp = 5;
-  optional int64 expiration = 6;
-  optional bytes messageId = 7;
-  optional bytes correlationId = 8;
-  optional bytes fromId =9;
-  optional bytes messageType = 10;
-  optional bytes payload = 11;
-  optional DestinationData destinationData = 12;  
-  optional DestinationData replyToData = 13;  
-  optional MapData mapData = 14;
-  optional bytes payload = 15;
+  optional int64 timestamp = 4;
+  optional int64 expiration = 5;
+  optional bytes messageId = 6;
+  optional bytes correlationId = 7;
+  optional bytes fromId =8;
+  optional bytes messageType = 9;
+  optional bytes payload = 10; 
+  optional DestinationData replyToData = 11;  
+  optional MapData mapData = 12;
+  optional bytes payload = 13;
 }
     
 message AckData {

Modified: activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/MulticastTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/MulticastTransportTest.java?rev=752825&r1=752824&r2=752825&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/MulticastTransportTest.java
(original)
+++ activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/MulticastTransportTest.java
Thu Mar 12 10:12:30 2009
@@ -48,7 +48,7 @@
         String payload = "test String";
         Buffer duff = new Buffer("duff");
         PacketDataBean packetData = new PacketDataBean();
-        packetData.setType(MessageType.MEMBER_DATA);
+        packetData.setMessageType(MessageType.MEMBER_DATA);
         packetData.setMessageId(new Buffer("foo"));
         packetData.setProducerId(duff);
         packetData.setSessionId(1);

Modified: activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/UdpTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/UdpTransportTest.java?rev=752825&r1=752824&r2=752825&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/UdpTransportTest.java
(original)
+++ activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/impl/transport/UdpTransportTest.java
Thu Mar 12 10:12:30 2009
@@ -53,7 +53,7 @@
             String payload = "test String";
             Buffer duff = new Buffer("duff");
             PacketDataBean packetData = new PacketDataBean();
-            packetData.setType(MessageType.MEMBER_DATA);
+            packetData.setMessageType(MessageType.MEMBER_DATA);
             packetData.setMessageId(new Buffer("foo"));
             packetData.setProducerId(duff);
             packetData.setSessionId(1);

Modified: activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/jms/perf/SimpleTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/jms/perf/SimpleTopicTest.java?rev=752825&r1=752824&r2=752825&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/jms/perf/SimpleTopicTest.java
(original)
+++ activemq/activemq-blaze/trunk/src/test/java/org/apache/activeblaze/jms/perf/SimpleTopicTest.java
Thu Mar 12 10:12:30 2009
@@ -21,7 +21,9 @@
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Session;
+
 import junit.framework.TestCase;
+
 import org.apache.activeblaze.jms.BlazeJmsConnectionFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -40,7 +42,7 @@
     protected int sampleCount = 20;
     protected long sampleInternal = 10000;
     protected int numberOfDestinations=1;
-    protected int numberOfConsumers = 20;
+    protected int numberOfConsumers = 2;
     protected int numberofProducers = 1;
     protected int totalNumberOfProducers;
     protected int totalNumberOfConsumers;



Mime
View raw message