Connection connection = null;
try
{ // Create the connection, passing it the configuration properties
ConnectionFactory factory = ConnectionFactory.newInstance();
factory.setProperties(props);
connection = factory.createConnection();
connection.setCredentials(creds);
} catch (JAXRException e) {
logger.log(Level.ERROR, "Could not set up a connection to the Registry. " + e.getMessage(), e);
}
return connection;