1 4 package com.tc.objectserver.gtx; 5 6 import com.tc.net.protocol.tcm.ChannelID; 7 import com.tc.object.tx.ServerTransactionID; 8 import com.tc.object.tx.TransactionID; 9 10 import java.io.IOException ; 11 import java.io.ObjectInputStream ; 12 import java.io.Serializable ; 13 14 public class GlobalTransactionDescriptor implements Serializable { 16 private final ServerTransactionID stxn; 17 18 public GlobalTransactionDescriptor(ServerTransactionID serverTransactionID) { 19 this.stxn = serverTransactionID; 20 } 21 22 public String toString() { 23 return "GlobalTransactionDescriptor[" + stxn + "]"; 24 } 25 26 public ChannelID getChannelID() { 27 return stxn.getChannelID(); 28 } 29 30 public TransactionID getClientTransactionID() { 31 return stxn.getClientTransactionID(); 32 } 33 34 private void writeObject(java.io.ObjectOutputStream out) throws IOException { 35 out.defaultWriteObject(); 36 } 37 38 private void readObject(ObjectInputStream in) throws IOException , ClassNotFoundException { 39 in.defaultReadObject(); 40 } 41 42 public int hashCode() { 43 return stxn.hashCode(); 44 } 45 46 public boolean equals(Object o) { 47 if (o == null) return false; 48 if (!(o instanceof GlobalTransactionDescriptor)) return false; 49 if (o == this) return true; 50 GlobalTransactionDescriptor c = (GlobalTransactionDescriptor) o; 51 return this.stxn.equals(c.stxn); 52 } 53 54 public ServerTransactionID getServerTransactionID() { 55 return stxn; 56 } 57 } 58 | Popular Tags |