ActiveMQConnectionRequestInfo connectionRequestInfo,
ActiveMQConnectionFactory connectionFactory) throws JMSException
{
String userName = connectionRequestInfo.getUserName();
String password = connectionRequestInfo.getPassword();
ActiveMQConnection physicalConnection = (ActiveMQConnection) connectionFactory.createConnection(userName, password);
String clientId = connectionRequestInfo.getClientid();
if ( clientId != null && clientId.length() > 0 )
{
physicalConnection.setClientID(clientId);
}
return physicalConnection;
}