public synchronized void setClientID(String loginName) throws JMSException {
if (log.isLoggable(Level.FINER))
log.finer("setClientID '" + loginName + "'");
if (!this.stillVirgin) {
throw new IllegalStateException(ME + ".setClientID: the clientId cannot be set since you made already invocations on this connection");
}
String oldId = getClientID();
if (oldId != null && oldId.length() > 0) {
throw new IllegalStateException(ME + ".setClientID: the clientId cannot be set since the administrator has already set an id to this connection via the Connection Factory");
}
// TODO check if the userId is already connected. If yes, then an IllegalStateException must be thrown
this.connectQos.getSecurityQos().setUserId(loginName);
}