protected ActiveMQConnection(ActiveMQConnectionFactory factory,
String theUserName, String thePassword) {
this.factory = factory;
this.userName = theUserName;
this.password = thePassword;
this.clientIdGenerator = new IdGenerator();
this.packetIdGenerator = new IdGenerator();
this.handleIdGenerator = new IdGenerator();
this.sessionIdGenerator = new IdGenerator();
this.consumerNumberGenerator = new SynchronizedInt(0);
this.sessions = new CopyOnWriteArrayList();
this.messageDispatchers = new CopyOnWriteArrayList();
this.connectionConsumers = new CopyOnWriteArrayList();
this.connectionMetaData = new ActiveMQConnectionMetaData();