KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ersatz > resourceadapter > RecordImpl


1 /*
2  * Created on March 3, 2004
3  *
4  * RecordImpl.java is used to test the J2EE Connector
5  * as implemented by JOnAS. This class implements the Record
6  * (cci) classes.
7  *
8  */

9 package ersatz.resourceadapter;
10
11 import javax.resource.cci.Record;
12 /**
13  * @author Bob Kruse
14  *
15  * Jtest Resource Adapter
16  *
17  * used to test the J2EE Connector as implemented by JOnAS.
18  *
19  */

20 public class RecordImpl
21         implements Record
22 {
23
24     private String Record_Name;
25     private String shortDescription;
26     String Id="RecordImpl"; // used in hashcode()
27
String cName = "RecordImpl";
28     
29     public RecordImpl() {
30         Utility.log(cName+".constructor");
31     }
32     public String getRecordName()
33     {
34         //Utility.log(cName+".getRecordName");
35
return Record_Name;
36     }
37     public void setRecordName(String rn)
38     {
39         //Utility.log(cName+".setRecordName");
40
Record_Name=rn;
41     }
42     public String getRecordShortDescription()
43     {
44         return shortDescription;
45     }
46     public void setRecordShortDescription(String rsd)
47     {
48         shortDescription=rsd;
49     }
50     public boolean equals(Object obj) {
51         boolean match = false;
52         if (obj==null) return match;
53         RecordImpl other = (RecordImpl)obj;
54         if (this.Id.equals(other.Id)) match = true;
55         return match;
56     }
57     public int hashCode() {
58         int hash = 1;
59         hash = Id.hashCode();
60         return hash;
61     }
62     public Object clone() throws CloneNotSupportedException
63     {
64         CloneNotSupportedException nse = new CloneNotSupportedException(
65                   "RecordImpl.clone is not currently supported");
66         throw nse;
67     }
68 }
69
Popular Tags