code: protected ConnectionListener findConnectionListener(ManagedConnection mc, Object c,
                                                         Collection<ConnectionListener> listeners)
     {
        for (ConnectionListener cl : listeners)
        {
           if (cl.getManagedConnection().equals(mc) && (c == null || cl.getConnections().contains(c)))
              return cl;
        }
  
        return null;
     }
docs: Find a ConnectionListener instance
  @param mc The associated ManagedConnection
  @param c The connection (optional)
  @param listeners The listeners
  @return The ConnectionListener, or <code>null</code>