qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1642996 - /qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
Date Mon, 15 Dec 2014 17:11:40 GMT
Author: tabish
Date: Tue Dec  2 19:47:50 2014
New Revision: 1642996

URL: http://svn.apache.org/r1642996
Log:
https://issues.apache.org/jira/browse/QPID-6100

Refine the exception message and throw a JMSSecurityException as defined by the spec and to
make tests more explicit about what they are expecting.

Modified:
    qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java

Modified: qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java?rev=1642996&r1=1642995&r2=1642996&view=diff
==============================================================================
--- qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
(original)
+++ qpid/trunk/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ConnectionImpl.java
Tue Dec  2 19:47:50 2014
@@ -29,6 +29,7 @@ import javax.jms.Destination;
 import javax.jms.ExceptionListener;
 import javax.jms.IllegalStateException;
 import javax.jms.JMSException;
+import javax.jms.JMSSecurityException;
 import javax.jms.Queue;
 import javax.jms.QueueConnection;
 import javax.jms.QueueSession;
@@ -186,7 +187,7 @@ public class ConnectionImpl implements C
                     }
                     else if(_conn.getEndpoint().requiresSASL() && !_conn.getEndpoint().isAuthenticated())
                     {
-                        throw new JMSException("Authentication Failed");
+                        throw new JMSSecurityException("Failed to authenitcate user[" + _username
+ "].");
                     }
                 }
                 catch (ConnectionException e)
@@ -264,7 +265,7 @@ public class ConnectionImpl implements C
             {
                 session.setMaxPrefetch(_maxPrefetch);
             }
-            
+
             boolean connectionStarted = false;
             synchronized(_lock)
             {
@@ -272,12 +273,12 @@ public class ConnectionImpl implements C
                 _sessions.add(session);
                 connectionStarted = _state == State.STARTED;
             }
-            
+
             if(connectionStarted)
             {
                 session.start();
             }
-            
+
             return session;
         }
         catch(JMSException e)
@@ -402,7 +403,7 @@ public class ConnectionImpl implements C
 
             _lock.notifyAll();
         }
-        
+
         if (startedSessions != null)
         {
             for(SessionImpl session : startedSessions)
@@ -449,7 +450,7 @@ public class ConnectionImpl implements C
                 closeTasks = new ArrayList<CloseTask>(_closeTasks);
                 closeConnection = _conn != null && _state != State.UNCONNECTED;
             }
-            
+
             _lock.notifyAll();
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message