[jboss-dev-forums] [Design of JCA on JBoss] - ManagedConnection AND ConnectionEventListener relationship i

vickyk do-not-reply at jboss.com
Wed Dec 12 04:25:03 EST 2007


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.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112183#4112183

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112183



More information about the jboss-dev-forums mailing list