📄 transactionid.java
字号:
package jm.framework.msn.entity;
/**
* 队列编号
* 梦界家园MSNP15
* @author ISHome
* @since 0.5.0.1
* @version 0.1
*/
public class TransactionId {
private static TransactionId instance = null;
public static TransactionId getInstance(){
if (instance == null){
instance = new TransactionId();
}
return instance;
}
private int trId = 0;
/**
* 获得队列编号
* @return
*/
public synchronized int nextTransactionId() {
trId++;
if (trId < 0) //Bigger than Integer.MAX_VALUE
trId = 1;
return trId;
}
@Override
public String toString() {
return ""+trId;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -