1 45 package org.openejb.test.object; 46 47 import java.io.IOException ; 48 import java.io.ObjectInput ; 49 import java.io.ObjectOutput ; 50 51 import javax.transaction.UserTransaction ; 52 57 public class Transaction implements java.io.Externalizable { 58 59 private String instance; 60 61 public Transaction(UserTransaction obj){ 62 instance = obj.getClass().getName() + "@" + Integer.toHexString(obj.hashCode()); 63 } 64 65 public Transaction(){ 66 } 67 68 public boolean equals(Object object){ 69 if ( !(object instanceof Transaction ) ) return false; 70 71 Transaction that = (Transaction)object; 72 return this.instance.equals(that.instance); 73 } 74 75 public void writeExternal(ObjectOutput out) throws IOException { 76 out.writeUTF(instance); 77 } 78 79 public void readExternal(ObjectInput in) throws IOException ,ClassNotFoundException { 80 instance = in.readUTF(); 81 } 82 83 public String toString(){ 84 return instance; 85 } 86 } 87 | Popular Tags |