1 package org.apache.ojb.odmg.locking; 2 3 17 18 import org.apache.ojb.odmg.TransactionImpl; 19 20 import java.io.Serializable ; 21 22 28 public class LockEntry implements Serializable 29 { 30 static final long serialVersionUID = 8060850552557793930L; 33 public static int LOCK_READ = 0; 34 35 38 public static int LOCK_WRITE = 1; 39 40 43 private String oidString; 44 45 48 private String transactionId; 49 50 53 private long timestamp; 54 55 58 private int isolationLevel; 59 60 65 private int lockType; 66 67 70 public LockEntry(String oidString, 71 String transactionId, 72 long timestamp, 73 int isolationLevel, 74 int lockType) 75 { 76 this.oidString = oidString; 77 this.transactionId = transactionId; 78 this.timestamp = timestamp; 79 this.isolationLevel = isolationLevel; 80 this.lockType = lockType; 81 82 } 83 84 87 public LockEntry(String oidString, String transactionId) 88 { 89 this.oidString = oidString; 90 this.transactionId = transactionId; 91 } 92 93 96 public LockEntry() 97 { 98 } 99 100 103 public String getOidString() 104 { 105 return oidString; 106 } 107 108 111 public String getTransactionId() 112 { 113 return transactionId; 114 } 115 116 119 public long getTimestamp() 120 { 121 return timestamp; 122 } 123 124 127 public int getIsolationLevel() 128 { 129 return isolationLevel; 130 } 131 132 137 public int getLockType() 138 { 139 return lockType; 140 } 141 142 146 public void setLockType(int locktype) 147 { 148 this.lockType = locktype; 149 } 150 151 154 public boolean isOwnedBy(TransactionImpl tx) 155 { 156 return this.getTransactionId().equals(tx.getGUID()); 157 } 158 159 160 164 public void setIsolationLevel(int isolationLevel) 165 { 166 this.isolationLevel = isolationLevel; 167 } 168 169 173 public void setOidString(String oidString) 174 { 175 this.oidString = oidString; 176 } 177 178 182 public void setTimestamp(long timestamp) 183 { 184 this.timestamp = timestamp; 185 } 186 187 191 public void setTransactionId(String transactionId) 192 { 193 this.transactionId = transactionId; 194 } 195 196 } 197 | Popular Tags |