001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018 package org.apache.geronimo.connector.outbound; 019 020 /** 021 * ConnectionInfo.java 022 * 023 * 024 * Created: Thu Sep 25 14:29:07 2003 025 * 026 * @version 1.0 027 */ 028 public class ConnectionInfo { 029 030 private ManagedConnectionInfo mci; 031 private Object connection; 032 private Object connectionProxy; 033 private boolean unshareable; 034 private boolean applicationManagedSecurity; 035 private Exception trace; 036 037 public ConnectionInfo() { 038 } // ConnectionInfo constructor 039 040 public ConnectionInfo(ManagedConnectionInfo mci) { 041 this.mci = mci; 042 } 043 044 /** 045 * Get the Mci value. 046 * @return the Mci value. 047 */ 048 public ManagedConnectionInfo getManagedConnectionInfo() { 049 return mci; 050 } 051 052 /** 053 * Set the Mci value. 054 * @param mci The new Mci value. 055 */ 056 public void setManagedConnectionInfo(ManagedConnectionInfo mci) { 057 this.mci = mci; 058 } 059 060 /** 061 * Get the Connection value. 062 * @return the Connection value. 063 */ 064 public Object getConnectionHandle() { 065 return connection; 066 } 067 068 /** 069 * Set the Connection value. 070 * @param connection The new Connection value. 071 */ 072 public void setConnectionHandle(Object connection) { 073 assert this.connection == null; 074 this.connection = connection; 075 } 076 077 public Object getConnectionProxy() { 078 return connectionProxy; 079 } 080 081 public void setConnectionProxy(Object connectionProxy) { 082 this.connectionProxy = connectionProxy; 083 } 084 085 public boolean isUnshareable() { 086 return unshareable; 087 } 088 089 public void setUnshareable(boolean unshareable) { 090 this.unshareable = unshareable; 091 } 092 093 public boolean isApplicationManagedSecurity() { 094 return applicationManagedSecurity; 095 } 096 097 public void setApplicationManagedSecurity(boolean applicationManagedSecurity) { 098 this.applicationManagedSecurity = applicationManagedSecurity; 099 } 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