KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > connector > outbound > ConnectionInfo


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.geronimo.connector.outbound;
19
20 /**
21  * ConnectionInfo.java
22  *
23  *
24  * Created: Thu Sep 25 14:29:07 2003
25  *
26  * @version 1.0
27  */

28 public class ConnectionInfo {
29
30     private ManagedConnectionInfo mci;
31     private Object JavaDoc connection;
32     private boolean unshareable;
33     private boolean applicationManagedSecurity;
34     private Exception JavaDoc trace;
35
36     public ConnectionInfo() {
37     } // ConnectionInfo constructor
38

39     public ConnectionInfo(ManagedConnectionInfo mci) {
40         this.mci = mci;
41     }
42
43     /**
44      * Get the Mci value.
45      * @return the Mci value.
46      */

47     public ManagedConnectionInfo getManagedConnectionInfo() {
48         return mci;
49     }
50
51     /**
52      * Set the Mci value.
53      * @param mci The new Mci value.
54      */

55     public void setManagedConnectionInfo(ManagedConnectionInfo mci) {
56         this.mci = mci;
57     }
58
59     /**
60      * Get the Connection value.
61      * @return the Connection value.
62      */

63     public Object JavaDoc getConnectionHandle() {
64         return connection;
65     }
66
67     /**
68      * Set the Connection value.
69      * @param connection The new Connection value.
70      */

71     public void setConnectionHandle(Object JavaDoc connection) {
72         assert this.connection == null;
73         this.connection = connection;
74     }
75
76     public boolean isUnshareable() {
77         return unshareable;
78     }
79
80     public void setUnshareable(boolean unshareable) {
81         this.unshareable = unshareable;
82     }
83
84     public boolean isApplicationManagedSecurity() {
85         return applicationManagedSecurity;
86     }
87
88     public void setApplicationManagedSecurity(boolean applicationManagedSecurity) {
89         this.applicationManagedSecurity = applicationManagedSecurity;
90     }
91
92     public boolean equals(Object JavaDoc obj) {
93         if (obj == this) {
94             return true;
95         }
96         if (obj instanceof ConnectionInfo) {
97             ConnectionInfo other = (ConnectionInfo) obj;
98             return (connection == other.connection)
99                     && (mci == other.mci);
100         }
101         return false;
102     }
103
104     public int hashCode() {
105         return ((connection != null) ? connection.hashCode() : 7) ^
106                 ((mci != null) ? mci.hashCode() : 7);
107     }
108
109     public void setTrace() {
110         this.trace = new Exception JavaDoc("Stack Trace");
111     }
112
113     public Exception JavaDoc getTrace() {
114         return trace;
115     }
116
117
118
119 } // ConnectionInfo
120
Popular Tags