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

    ManagedConnection AND ConnectionEventListener relationship i

    vickyk

      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.


        • 1. Re: ManagedConnection AND ConnectionEventListener relationsh

           

          "vickyk" wrote:
          After going though the JCA specs I could make that there is one-one relationship between ConnectionEventListener AND ManagedConnection.
          In the BaseWrapperManagedConnection


          Where? That is not correct. The fact that we only register one ConnectionEventListener
          (the connection manager) is an implementation detail of ours, it is not in the spec,
          you can have many listeners if you want.

          • 2. Re: ManagedConnection AND ConnectionEventListener relationsh
            vickyk

             

            "adrian@jboss.org" wrote:

            Where? That is not correct. The fact that we only register one ConnectionEventListener
            (the connection manager) is an implementation detail of ours, it is not in the spec,
            you can have many listeners if you want.

            Ok , that was due to my wrong interpretation of specs :( .