activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bsny...@apache.org
Subject svn commit: r789520 - in /activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp: ExceededMaximumConnectionsException.java TcpTransportServer.java
Date Tue, 30 Jun 2009 01:08:20 GMT
Author: bsnyder
Date: Tue Jun 30 01:08:19 2009
New Revision: 789520

URL: http://svn.apache.org/viewvc?rev=789520&view=rev
Log:
Added a better exception and error message for exceeding the maximumConnections - AMQ-1928

Added:
    activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java
  (with props)
Modified:
    activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java

Added: activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java
URL: http://svn.apache.org/viewvc/activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java?rev=789520&view=auto
==============================================================================
--- activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java
(added)
+++ activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java
Tue Jun 30 01:08:19 2009
@@ -0,0 +1,22 @@
+package org.apache.activemq.transport.tcp;
+
+/**
+ * Thrown to indicate that the {@link TcpTransportServer#maximumConnections} 
+ * property has been exceeded. 
+ * 
+ * @see {@link TcpTransportServer#maximumConnections}
+ * @author bsnyder
+ *
+ */
+public class ExceededMaximumConnectionsException extends Exception {
+
+    /**
+     * Default serial version id for serialization
+     */
+    private static final long serialVersionUID = -1166885550766355524L;
+
+    public ExceededMaximumConnectionsException(String message) {
+        super(message);
+    }
+
+}

Propchange: activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ExceededMaximumConnectionsException.java
------------------------------------------------------------------------------
    svn:keywords = Id Revision

Modified: activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java?rev=789520&r1=789519&r2=789520&view=diff
==============================================================================
--- activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
(original)
+++ activemq/tags/activemq-5.2.0/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
Tue Jun 30 01:08:19 2009
@@ -381,8 +381,10 @@
     protected final void handleSocket(Socket socket) {
         try {
             if (this.currentTransportCount >= this.maximumConnections) {
-                
-            }else {
+                throw new ExceededMaximumConnectionsException("Exceeded the maximum " + 
+                        "number of allowed client connections. See the 'maximumConnections'
" + 
+                        "property on the TCP transport configuration URI in the ActiveMQ
configuration file (e.g., activemq.xml)"); 
+            } else {
             HashMap<String, Object> options = new HashMap<String, Object>();
             options.put("maxInactivityDuration", Long
                     .valueOf(maxInactivityDuration));



Mime
View raw message