1 24 package org.objectweb.jalisto.se.jca.data; 25 26 import org.objectweb.jalisto.se.jca.JalistoConnectionSpec; 27 28 import javax.resource.cci.ConnectionSpec ; 29 import javax.resource.spi.ConnectionRequestInfo ; 30 31 public class JalistoConnectionRequestInfo implements ConnectionRequestInfo { 32 private Object password = ""; 33 private Object userName = ""; 34 35 public JalistoConnectionRequestInfo(ConnectionSpec spec) { 36 if (spec != null) { 37 try { 38 JalistoConnectionSpec jdoSpec = (JalistoConnectionSpec) spec; 39 userName = jdoSpec.getUserName(); 40 password = jdoSpec.getPassword(); 41 } catch (ClassCastException cce) { 42 } 43 } 44 } 45 46 public boolean equals(Object obj) { 47 if (obj == null) { 48 return false; 49 } 50 if (obj instanceof JalistoConnectionRequestInfo) { 51 JalistoConnectionRequestInfo candidate = (JalistoConnectionRequestInfo) obj; 52 return (this.userName.equals(candidate.userName) && this.password.equals(candidate.password)); 53 } 54 return false; 55 } 56 57 public int hashCode() { 58 return super.hashCode(); 59 } 60 61 public String toString() { 62 return "JalistoConnectionRequestInfo : username=" + 63 String.valueOf(userName) + ", password=" + 64 String.valueOf(password); 65 } 66 } 67 | Popular Tags |