1 5 package com.tc.l2.objectserver; 6 7 import com.tc.l2.msg.ObjectSyncMessage; 8 import com.tc.object.tx.TransactionID; 9 import com.tc.objectserver.tx.ServerTransaction; 10 11 public class ServerTransactionFactory { 12 13 private static long tid = 1; 14 15 public static ServerTransaction createTxnFrom(ObjectSyncMessage syncMsg) { 16 ObjectSyncServerTransaction txn = new ObjectSyncServerTransaction(getNextTransactionID(), syncMsg.getOids(), 17 syncMsg.getDnaCount(), syncMsg.getSerializer(), 18 syncMsg.getDNAs(), syncMsg.getRootsMap()); 19 return txn; 20 } 21 22 private static synchronized TransactionID getNextTransactionID() { 23 return new TransactionID(tid++); 24 } 25 26 } 27 | Popular Tags |