生成近似的uuid
?private static long tmpID = 0;
?
?private static boolean tmpIDlocked = false;
?
?private static long getUniqueId() {
??long ltime = 0;
??while (true) {
???if(tmpIDlocked == false) {
????tmpIDlocked= true;
????ltime= Long.valueOf(new SimpleDateFormat("yyMMddhhmmssSSS")
??????.format(newDate()).toString()) * 10000;
????if(tmpID < ltime) {
?????tmpID= ltime;
????}else {
?????tmpID= tmpID + 1;
?????ltime= tmpID;
????}
????tmpIDlocked= false;
????returnltime;
???}
??}
?}