[hornetq-commits] JBoss hornetq SVN: r12294 - trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Mar 13 08:04:46 EDT 2012


Author: borges
Date: 2012-03-13 08:04:45 -0400 (Tue, 13 Mar 2012)
New Revision: 12294

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
Log:
Throw the correct exception

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java	2012-03-13 12:04:31 UTC (rev 12293)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java	2012-03-13 12:04:45 UTC (rev 12294)
@@ -30,6 +30,7 @@
 import org.hornetq.core.protocol.core.Channel;
 import org.hornetq.core.protocol.core.CoreRemotingConnection;
 import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.protocol.core.impl.ChannelImpl.CHANNEL_ID;
 import org.hornetq.core.protocol.core.impl.wireformat.DisconnectMessage;
 import org.hornetq.core.remoting.CloseListener;
 import org.hornetq.core.remoting.FailureListener;
@@ -78,11 +79,7 @@
 
    private int clientVersion;
 
-   // Channels 0-9 are reserved for the system
-   // 0 is for pinging
-   // 1 is for session creation and attachment
-   // 2 is for replication
-   private volatile SimpleIDGenerator idGenerator = new SimpleIDGenerator(10);
+   private volatile SimpleIDGenerator idGenerator = new SimpleIDGenerator(CHANNEL_ID.USER.id);
 
    private boolean idGeneratorSynced = false;
 
@@ -247,9 +244,8 @@
    {
       if (listener == null)
       {
-         throw new IllegalStateException("FailureListener cannot be null");
+         throw new IllegalArgumentException("FailureListener cannot be null");
       }
-
       failureListeners.add(listener);
    }
 
@@ -257,7 +253,7 @@
    {
       if (listener == null)
       {
-         throw new IllegalStateException("FailureListener cannot be null");
+         throw new IllegalArgumentException("FailureListener cannot be null");
       }
 
       return failureListeners.remove(listener);
@@ -267,7 +263,7 @@
    {
       if (listener == null)
       {
-         throw new IllegalStateException("CloseListener cannot be null");
+         throw new IllegalArgumentException("CloseListener cannot be null");
       }
 
       closeListeners.add(listener);
@@ -277,7 +273,7 @@
    {
       if (listener == null)
       {
-         throw new IllegalStateException("CloseListener cannot be null");
+         throw new IllegalArgumentException("CloseListener cannot be null");
       }
 
       return closeListeners.remove(listener);



More information about the hornetq-commits mailing list