View Javadoc

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 connection;
32      private Object connectionProxy;
33      private boolean unshareable;
34      private boolean applicationManagedSecurity;
35      private Exception trace;
36  
37      public ConnectionInfo() {
38      } // ConnectionInfo constructor
39  
40      public ConnectionInfo(ManagedConnectionInfo mci) {
41          this.mci = mci;
42      }
43  
44      /**
45       * Get the Mci value.
46       * @return the Mci value.
47       */
48      public ManagedConnectionInfo getManagedConnectionInfo() {
49          return mci;
50      }
51  
52      /**
53       * Set the Mci value.
54       * @param mci The new Mci value.
55       */
56      public void setManagedConnectionInfo(ManagedConnectionInfo mci) {
57          this.mci = mci;
58      }
59  
60      /**
61       * Get the Connection value.
62       * @return the Connection value.
63       */
64      public Object getConnectionHandle() {
65          return connection;
66      }
67  
68      /**
69       * Set the Connection value.
70       * @param connection The new Connection value.
71       */
72      public void setConnectionHandle(Object connection) {
73          assert this.connection == null;
74          this.connection = connection;
75      }
76  
77      public Object getConnectionProxy() {
78          return connectionProxy;
79      }
80  
81      public void setConnectionProxy(Object connectionProxy) {
82          this.connectionProxy = connectionProxy;
83      }
84  
85      public boolean isUnshareable() {
86          return unshareable;
87      }
88  
89      public void setUnshareable(boolean unshareable) {
90          this.unshareable = unshareable;
91      }
92  
93      public boolean isApplicationManagedSecurity() {
94          return applicationManagedSecurity;
95      }
96  
97      public void setApplicationManagedSecurity(boolean applicationManagedSecurity) {
98          this.applicationManagedSecurity = applicationManagedSecurity;
99      }
100 
101     public boolean equals(Object obj) {
102         if (obj == this) {
103             return true;
104         }
105         if (obj instanceof ConnectionInfo) {
106             ConnectionInfo other = (ConnectionInfo) obj;
107             return (connection == other.connection)
108                     && (mci == other.mci);
109         }
110         return false;
111     }
112 
113     public int hashCode() {
114         return ((connection != null) ? connection.hashCode() : 7) ^
115                 ((mci != null) ? mci.hashCode() : 7);
116     }
117 
118     public void setTrace() {
119         this.trace = new Exception("Stack Trace");
120     }
121 
122     public Exception getTrace() {
123         return trace;
124     }
125 
126 
127 
128 } // ConnectionInfo