[jboss-cvs] JBoss Messaging SVN: r4484 - in trunk: src/main/org/jboss/messaging/core/message and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 16 11:22:53 EDT 2008


Author: jmesnil
Date: 2008-06-16 11:22:53 -0400 (Mon, 16 Jun 2008)
New Revision: 4484

Modified:
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientMessageImpl.java
   trunk/src/main/org/jboss/messaging/core/message/Message.java
   trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java
   trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java
   trunk/src/main/org/jboss/messaging/jms/client/JBossMessage.java
   trunk/tests/src/org/jboss/messaging/tests/performance/persistence/impl/StorageManagerTimingTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/message/impl/MessageTest.java
   trunk/tests/src/org/jboss/messaging/tests/util/UnitTestCase.java
Log:
represent core message's type with a byte (instead of an int)

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientMessageImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientMessageImpl.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientMessageImpl.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -52,20 +52,20 @@
    /*
     * Construct messages before sending
     */
-   public ClientMessageImpl(final int type, final boolean durable, final long expiration,
+   public ClientMessageImpl(final byte type, final boolean durable, final long expiration,
                             final long timestamp, final byte priority)
    {
       super(type, durable, expiration, timestamp, priority);
    }
    
-   public ClientMessageImpl(final int type, final boolean durable)
+   public ClientMessageImpl(final byte type, final boolean durable)
    {
       super(type, durable, 0, System.currentTimeMillis(), (byte)4);
    }
    
    public ClientMessageImpl(final boolean durable)
    {
-      super(0, durable, 0, System.currentTimeMillis(), (byte)4);
+      super((byte) 0, durable, 0, System.currentTimeMillis(), (byte)4);
    }
    
    public void setDeliveryCount(final int deliveryCount)

Modified: trunk/src/main/org/jboss/messaging/core/message/Message.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/message/Message.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/src/main/org/jboss/messaging/core/message/Message.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -45,7 +45,7 @@
    
    void setDestination(SimpleString destination);
    
-   int getType();   
+   byte getType();   
       
    boolean isDurable();
    

Modified: trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -61,7 +61,7 @@
 
    private SimpleString destination;
    
-   private int type;
+   private byte type;
    
    protected boolean durable;
 
@@ -84,7 +84,7 @@
       this.properties = new TypedProperties();
    }
    
-   protected MessageImpl(final int type, final boolean durable, final long expiration,
+   protected MessageImpl(final byte type, final boolean durable, final long expiration,
                       final long timestamp, final byte priority)
    {
       this();
@@ -116,7 +116,7 @@
    public void encode(MessagingBuffer buff)
    {
       buff.putSimpleString(destination);
-      buff.putInt(type);
+      buff.putByte(type);
       buff.putBoolean(durable);
       buff.putLong(expiration);
       buff.putLong(timestamp);
@@ -129,7 +129,7 @@
    public int encodeSize()
    {
       return /* Destination */ SimpleString.sizeofString(destination) + 
-      /* Type */ SIZE_INT + 
+      /* Type */ SIZE_BYTE + 
       /* Durable */ SIZE_BOOLEAN + 
       /* Expiration */ SIZE_LONG + 
       /* Timestamp */ SIZE_LONG + 
@@ -141,7 +141,7 @@
    public void decode(final MessagingBuffer buffer)
    {
       destination = buffer.getSimpleString();
-      type = buffer.getInt();
+      type = buffer.getByte();
       durable = buffer.getBoolean();
       expiration = buffer.getLong();
       timestamp = buffer.getLong();
@@ -167,7 +167,7 @@
       this.destination = destination;
    }
    
-   public int getType()
+   public byte getType()
    {
       return type;
    }

Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -75,7 +75,7 @@
    /**
     * Only used in testing
     */
-   public ServerMessageImpl(final int type, final boolean durable, final long expiration,
+   public ServerMessageImpl(final byte type, final boolean durable, final long expiration,
                             final long timestamp, final byte priority)
    {
       super(type, durable, expiration, timestamp, priority);

Modified: trunk/src/main/org/jboss/messaging/jms/client/JBossMessage.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/client/JBossMessage.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/src/main/org/jboss/messaging/jms/client/JBossMessage.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -86,7 +86,7 @@
    //Used when bridging a message
    public static final String JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST = "JBM_BRIDGE_MSG_ID_LIST";
    
-   private static final int TYPE = 0;
+   public static final byte TYPE = 0;
    
    // Static --------------------------------------------------------
 
@@ -173,7 +173,7 @@
    /*
     * Create a new message prior to sending
     */
-   protected JBossMessage(final int type)
+   protected JBossMessage(final byte type)
    {
       message = new ClientMessageImpl(type, true, 0, System.currentTimeMillis(), (byte)4);
       
@@ -208,7 +208,7 @@
       this(foreign, JBossMessage.TYPE);
    }
       
-   protected JBossMessage(final Message foreign, final int type) throws JMSException
+   protected JBossMessage(final Message foreign, final byte type) throws JMSException
    {
       this(type);
 

Modified: trunk/tests/src/org/jboss/messaging/tests/performance/persistence/impl/StorageManagerTimingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/performance/persistence/impl/StorageManagerTimingTest.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/tests/src/org/jboss/messaging/tests/performance/persistence/impl/StorageManagerTimingTest.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -173,7 +173,7 @@
                   final SimpleString address = new SimpleString("Destination " + i);
 
                   
-                  ServerMessageImpl implMsg = new ServerMessageImpl(/* type */ 1, /* durable */ true, /* expiration */ 0,
+                  ServerMessageImpl implMsg = new ServerMessageImpl(/* type */ (byte)1, /* durable */ true, /* expiration */ 0,
                         /* timestamp */ 0, /* priority */(byte)0);
                   
                   implMsg.putStringProperty(new SimpleString("Key"), new SimpleString("This String is worthless!"));

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/message/impl/MessageTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/message/impl/MessageTest.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/message/impl/MessageTest.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -57,7 +57,7 @@
    public void testCreateMessageBeforeSending()
    {
       long id = 56465;
-      int type = 655;
+      byte type = (byte) 655;
       boolean reliable = true;
       long expiration = 6712671;
       long timestamp = 82798172;
@@ -285,7 +285,7 @@
       
       SimpleString address = new SimpleString("Simple Destination ");
       
-      ServerMessageImpl implMsg = new ServerMessageImpl(/* type */ 1, /* durable */ true, /* expiration */ 0,
+      ServerMessageImpl implMsg = new ServerMessageImpl(/* type */ (byte)1, /* durable */ true, /* expiration */ 0,
             /* timestamp */ 0, /* priority */(byte)0);
       
       implMsg.setDestination(address);

Modified: trunk/tests/src/org/jboss/messaging/tests/util/UnitTestCase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/util/UnitTestCase.java	2008-06-16 14:13:25 UTC (rev 4483)
+++ trunk/tests/src/org/jboss/messaging/tests/util/UnitTestCase.java	2008-06-16 15:22:53 UTC (rev 4484)
@@ -199,7 +199,7 @@
          
    protected ServerMessage generateMessage(long id)
    {
-      ServerMessage message = new ServerMessageImpl(0, true, 0, System.currentTimeMillis(), (byte)4);
+      ServerMessage message = new ServerMessageImpl((byte)0, true, 0, System.currentTimeMillis(), (byte)4);
       
       message.setMessageID(id);
       




More information about the jboss-cvs-commits mailing list