[jboss-cvs] JBoss Messaging SVN: r7676 - trunk/src/main/org/jboss/messaging/core/remoting/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 6 15:36:50 EDT 2009


Author: timfox
Date: 2009-08-06 15:36:50 -0400 (Thu, 06 Aug 2009)
New Revision: 7676

Modified:
   trunk/src/main/org/jboss/messaging/core/remoting/impl/ChannelImpl.java
Log:
removed weird if block

Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/ChannelImpl.java	2009-08-06 17:15:13 UTC (rev 7675)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/ChannelImpl.java	2009-08-06 19:36:50 UTC (rev 7676)
@@ -110,7 +110,7 @@
 
       this.windowSize = windowSize;
 
-      this.confWindowSize = (int) (0.75 * windowSize);
+      this.confWindowSize = (int)(0.75 * windowSize);
 
       if (this.windowSize != -1)
       {
@@ -182,11 +182,10 @@
          packet.setChannelID(id);
 
          final MessagingBuffer buffer = connection.getTransportConnection()
-               .createBuffer(packet.getRequiredBufferSize());
+                                                  .createBuffer(packet.getRequiredBufferSize());
 
          int size = packet.encode(buffer);
 
-
          lock.lock();
 
          try
@@ -253,7 +252,7 @@
          packet.setChannelID(id);
 
          final MessagingBuffer buffer = connection.getTransportConnection()
-               .createBuffer(packet.getRequiredBufferSize());
+                                                  .createBuffer(packet.getRequiredBufferSize());
 
          int size = packet.encode(buffer);
 
@@ -316,7 +315,7 @@
 
             if (response.getType() == PacketImpl.EXCEPTION)
             {
-               final MessagingExceptionMessage mem = (MessagingExceptionMessage) response;
+               final MessagingExceptionMessage mem = (MessagingExceptionMessage)response;
 
                throw mem.getException();
             }
@@ -368,7 +367,7 @@
             }
 
             final MessagingBuffer buffer = connection.getTransportConnection()
-                  .createBuffer(packet.getRequiredBufferSize());
+                                                     .createBuffer(packet.getRequiredBufferSize());
 
             packet.encode(buffer);
 
@@ -483,7 +482,7 @@
 
          // And switch it
 
-         final RemotingConnectionImpl rnewConnection = (RemotingConnectionImpl) newConnection;
+         final RemotingConnectionImpl rnewConnection = (RemotingConnectionImpl)newConnection;
 
          rnewConnection.putChannel(newChannelID, this);
 
@@ -544,54 +543,27 @@
       }
    }
 
-   public synchronized void  confirm(final Packet packet)
+   public synchronized void confirm(final Packet packet)
    {
-      if (packet.getType() == PacketImpl.SESS_ACKNOWLEDGE || packet.getType() == PacketImpl.CREATESESSION || packet.getType() == PacketImpl.SESS_CREATECONSUMER
-            || packet.getType() == PacketImpl.SESS_START || packet.getType() == PacketImpl.PING || packet.getType() == PacketImpl.SESS_FLOWTOKEN)
+      if (resendCache != null && packet.isRequiresConfirmations())
       {
-         if (resendCache != null && packet.isRequiresConfirmations())
-         {
-            lastReceivedCommandID++;
+         lastReceivedCommandID++;
 
-            receivedBytes += packet.getPacketSize();
-            if (receivedBytes >= confWindowSize)
-            {
-               receivedBytes = 0;
-
-               if (connection.isActive())
-               {
-                  final Packet confirmed = new PacketsConfirmedMessage(lastReceivedCommandID);
-
-                  confirmed.setChannelID(id);
-
-                  doWrite(confirmed);
-               }
-            }
-         }
-      }
-      else
-      {
-         if (resendCache != null && packet.isRequiresConfirmations())
+         receivedBytes += packet.getPacketSize();
+         if (receivedBytes >= confWindowSize)
          {
-            lastReceivedCommandID++;
+            receivedBytes = 0;
 
-            receivedBytes += packet.getPacketSize();
-            if (receivedBytes >= confWindowSize)
+            if (connection.isActive())
             {
-               receivedBytes = 0;
+               final Packet confirmed = new PacketsConfirmedMessage(lastReceivedCommandID);
 
-               if (connection.isActive())
-               {
-                  final Packet confirmed = new PacketsConfirmedMessage(lastReceivedCommandID);
-                  confirmed.setChannelID(id);
+               confirmed.setChannelID(id);
 
-                  doWrite(confirmed);
-               }
+               doWrite(confirmed);
             }
          }
-
       }
-
    }
 
    public void handlePacket(final Packet packet)
@@ -600,7 +572,7 @@
       {
          if (resendCache != null)
          {
-            final PacketsConfirmedMessage msg = (PacketsConfirmedMessage) packet;
+            final PacketsConfirmedMessage msg = (PacketsConfirmedMessage)packet;
 
             clearUpTo(msg.getCommandID());
          }




More information about the jboss-cvs-commits mailing list