private HandlerType handlerType;
private Action action;
+ private int transactionId;
+
+ public int getTransactionId() {
+ return transactionId;
+ }
+
+ private static int txId = 0;
+ private static int incTxId() {
+ return ++txId;
+ }
+ public static int getTxId() {
+ return txId;
+ }
private AbstractEvent() {
// this is private to force proper construction
protected AbstractEvent(HandlerType handlerType, Action action) {
this.handlerType = handlerType;
this.action = action;
+ this.transactionId = incTxId();
}
public HandlerType getHandlerType() {
@Override
public String toString() {
- return "AbstractEvent [handlerType=" + handlerType + " action=" + action + "]";
+ return "AbstractEvent [transactionId=" + transactionId
+ + " handlerType=" + handlerType + " action=" + action + "]";
}
@Override