01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.l2.objectserver;
06:
07: import com.tc.l2.msg.ObjectSyncMessage;
08: import com.tc.object.tx.TransactionID;
09: import com.tc.objectserver.tx.ServerTransaction;
10:
11: public class ServerTransactionFactory {
12:
13: private static long tid = 1;
14:
15: public static ServerTransaction createTxnFrom(
16: ObjectSyncMessage syncMsg) {
17: ObjectSyncServerTransaction txn = new ObjectSyncServerTransaction(
18: getNextTransactionID(), syncMsg.getOids(), syncMsg
19: .getDnaCount(), syncMsg.getDNAs(), syncMsg
20: .getRootsMap(), syncMsg.messageFrom());
21: return txn;
22: }
23:
24: private static synchronized TransactionID getNextTransactionID() {
25: return new TransactionID(tid++);
26: }
27:
28: }
|