if (obj instanceof JmsManagedConnection) {
// This is one from the pool
JmsManagedConnection mc = (JmsManagedConnection) obj;
// Check if we even created this on
ManagedConnectionFactory mcf = mc.getManagedConnectionFactory();
// Only admit a connection if it has the same username as our
// asked for creds
// FIXME, Here we have a problem, jms connection
// may be anonymous, have a user name
if ((mc.getUserName() == null || (mc.getUserName() != null && mc.getUserName().equals(cred.name)))
&& mcf.equals(this)) {
// Now check if ConnectionInfo equals
if (info.equals(mc.getInfo())) {
if (trace)
log.trace("Found matching connection: " + mc);