* with a {@link CountDownLatch} to synchronise in the {@link #check403Exception(Throwable)} method and allow the
* {@link #tearDown()} method to complete properly.
*/
public Connection getConnection(String vhost, String username, String password) throws NamingException, JMSException, URLSyntaxException
{
AMQConnection connection = (AMQConnection) getConnection(createConnectionURL(vhost, username, password));
//Prevent Failover
connection.setConnectionListener(this);
//QPID-2081: use a latch to sync on exception causing connection close, to work
//around the connection close race during tearDown() causing sporadic failures
_exceptionReceived = new CountDownLatch(1);
connection.setExceptionListener(new ExceptionListener()
{
public void onException(JMSException e)
{
_exceptionReceived.countDown();
}