Source Code Cross Referenced for ConnectionRequestInfoImpl.java in  » J2EE » JOnAS-4.8.6 » ersatz » resourceadapter » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » ersatz.resourceadapter 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on December 11, 2003
003:         *
004:         * ConnectionRequestInfoImpl.java is used to test the J2EE Connector 1.5
005:         * as implemented by JOnAS. 
006:         */
007:        package ersatz.resourceadapter;
008:
009:        import javax.naming.Reference;
010:        import javax.resource.spi.ConnectionRequestInfo;
011:
012:        /**
013:         * @author Bob Kruse
014:         *
015:         * used to test the J2EE Connector as implemented by JOnAS.
016:         *
017:         */
018:        public class ConnectionRequestInfoImpl implements  ConnectionRequestInfo {
019:            Reference reference;
020:            // Resource adapter name form EIS_URL <config-property>
021:            public String raName = "";
022:            // Managed Connection Factory <config-property>s
023:            String serverName = "";
024:            String portNumber = "";
025:            String userName = "";
026:            String password = "";
027:            String protocol = "";
028:
029:            String Id = ""; // used in hashcode() for ConnectionRequestInfo
030:            String cName = "ConnectionRequestInfoImpl";
031:
032:            //
033:            // constructor  
034:            public ConnectionRequestInfoImpl() {
035:                Id = "";
036:                Utility.log(cName + "() " + this );
037:            }
038:
039:            public ConnectionRequestInfoImpl(ConnectionRequestInfoImpl crii) {
040:                raName = crii.raName;
041:                serverName = crii.serverName;
042:                portNumber = crii.portNumber;
043:                userName = crii.userName;
044:                password = crii.password;
045:                protocol = crii.protocol;
046:                Id = "";
047:                Utility.log(cName + "(crii) " + this );
048:
049:            }
050:
051:            //          module to add additional connection properties than   
052:            //          the ones configured for the ConnectionFactory.  This  
053:            //          class is passed to the App Server and will be used    
054:            //          on matchManagedConnections or createConnection        
055:            //          methods by the App Server.                            
056:            //                                                                
057:            //
058:            public void setUserName(String u) {
059:                userName = u;
060:                Utility.log(cName + ".setUserName=" + u);
061:            }
062:
063:            public void setPassword(String p) {
064:                password = p;
065:                Utility.log(cName + ".setPassword=" + p);
066:            }
067:
068:            public String getUserName() {
069:                Utility.log(cName + ".getUserName=" + userName);
070:                return userName;
071:            }
072:
073:            public String getPassword() {
074:                Utility.log(cName + ".getPassword=" + password);
075:                return password;
076:            }
077:
078:            public void setRaName(String s) {
079:                raName = s;
080:            }
081:
082:            public void setServerName(String s) {
083:                serverName = s;
084:            }
085:
086:            public void setPortNumber(String s) {
087:                portNumber = s;
088:            }
089:
090:            public void setProtocol(String s) {
091:                protocol = s;
092:            }
093:
094:            public String getRaName() {
095:                return raName;
096:            }
097:
098:            public String getServerName() {
099:                return serverName;
100:            }
101:
102:            public String getPortNumber() {
103:                return portNumber;
104:            }
105:
106:            public String getProtocol() {
107:                return protocol;
108:            }
109:
110:            private void setId() {
111:                if (Id == null || Id.length() == 0)
112:                    Id = raName + serverName + portNumber + userName + password
113:                            + protocol;
114:
115:            }
116:
117:            public String getId() {
118:                setId();
119:                return Id;
120:
121:            }
122:
123:            //
124:            // hashCode and equals method used in ConnectionRequestInfo,
125:            //                                    ManagedConnectionFactory
126:            public int hashCode() {
127:                setId();
128:                int hash = Id.hashCode();
129:                return hash;
130:            }
131:
132:            public boolean equals(Object obj) {
133:                boolean ret = false;
134:                if (obj != null) {
135:                    if (obj instanceof  ConnectionRequestInfoImpl) {
136:                        ConnectionRequestInfoImpl other = (ConnectionRequestInfoImpl) obj;
137:                        try {
138:                            ret = raName.equalsIgnoreCase(other.raName)
139:                                    && serverName
140:                                            .equalsIgnoreCase(other.serverName)
141:                                    && portNumber
142:                                            .equalsIgnoreCase(other.portNumber)
143:                                    && userName
144:                                            .equalsIgnoreCase(other.userName)
145:                                    && password
146:                                            .equalsIgnoreCase(other.password)
147:                                    && protocol
148:                                            .equalsIgnoreCase(other.protocol);
149:                        } catch (Exception e) {
150:                            ret = false;
151:                        }
152:                    }
153:                }
154:                Utility.log(cName + ".equals " + ret);
155:                return ret;
156:            }
157:
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.