1 4 package com.tc.object.tx; 5 6 import com.tc.object.lockmanager.api.LockID; 7 8 import java.util.ArrayList ; 9 import java.util.Arrays ; 10 import java.util.List ; 11 12 public class TransactionContext { 13 TxnType type; 14 LockID lockID; 15 private LockID[] lockIDs; 16 17 public TransactionContext(LockID lockID, TxnType type, LockID[] lockIDs) { 18 this.type = type; 19 this.lockID = lockID; 20 this.lockIDs = lockIDs; 21 } 22 23 public TxnType getType() { 24 return type; 25 } 26 27 public LockID getLockID() { 28 return lockID; 29 } 30 31 public LockID[] getAllLockIDs() { 32 return lockIDs; 33 } 34 35 public void removeLock(LockID id) { 36 List list = new ArrayList (Arrays.asList(lockIDs)); 37 list.remove(id); 38 lockIDs = new LockID[list.size()]; 39 for (int i=0; i<lockIDs.length; i++) { 40 lockIDs[i] = (LockID)list.get(i); 41 } 42 } 43 } | Popular Tags |