Returns the next unique id for an application or
stand alone ejb module.
synchronized (this) {
while (true) {
long uid = System.currentTimeMillis();
// uses the low order 6 bytes as unique id;
// remaining 2 bytes are reserved for the beans inside the app
uid = (uid << 16);
// ensures that we have a unique id
if (this._lastUid != uid) {
this._lastUid = uid;
break;
} else {
try {
Thread.currentThread().sleep(1);
} catch (InterruptedException ie) {
// log debug msg here
_logger.log(Level.WARNING,"Thread.sleep interrupted ",ie);
}
}
}
return this._lastUid;
}