2 Replies Latest reply on Dec 12, 2007 5:52 AM by Vicky Kak

    ManagedConnection AND ConnectionEventListener relationship i

    Vicky Kak Master

      After going though the JCA specs I could make that there is one-one relationship between ConnectionEventListener AND ManagedConnection.
      In the BaseWrapperManagedConnection I can see

      private final Collection cels = new ArrayList();

      The closeHandle(Object) in the BaseWrapperManagedConnection has
      synchronized(cels)
       {
       copy = new ArrayList(cels);
       }
       for (Iterator i = copy.iterator(); i.hasNext(); )
       {
       ConnectionEventListener cel = (ConnectionEventListener)i.next();
       cel.connectionClosed(ce);
       }


      which could have been replaced by
      cel.connectionClosed(ce)

      if we have this
      private final Collection cels = new ArrayList();

      replaced by
      private ConnectionEventListener cel ;


      I am not able to understand why we have ConnectionEventListener associated with ManagedConnection stored as ArrayList as I expect this ArrayList will always have single CEL.