KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ersatz > resourceadapter > ConnectionMetaDataImpl


1 /*
2  * Created on December 11, 2003
3  *
4  * ConnectionMetaDataImpl.java is used to test the J2EE Connector
5  * as implemented by JOnAS.
6  *
7  */

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

21 public class ConnectionMetaDataImpl
22         implements ConnectionMetaData
23 {
24     public String product="Ersatz EIS"; // see J2eeConnectorTestBeanClient
25
String version="1.1";
26     String UserName="Ersatz_User_Name"; //
27
private ManagedConnectionImpl mc;
28     private ConnectionImpl conn;
29     String cName = "ConnectionImpl";
30
31     //
32
// The method getUserName returns the user name for an active connection as
33
// known to the underlying EIS instance. The name corresponds the resource
34
// principal under whose security context a connection to the EIS
35
// instance has been established.
36
//
37
public ConnectionMetaDataImpl(ConnectionImpl c, ManagedConnectionImpl mc) { // constructor
38
Utility.log(cName+".constructor");
39         this.mc=mc;
40         this.conn=c;
41     }
42     public String getEISProductName()
43                                        throws ResourceException
44     {
45         return (product);
46     }
47     public String getEISProductVersion()
48                                           throws ResourceException
49     {
50         return (version);
51     }
52     public String getUserName()
53                                           throws ResourceException
54     {
55         return (UserName);
56     }
57 }
58
Popular Tags