0 Replies Latest reply on Dec 12, 2011 1:32 AM by rosansamuel

    Difference Between Jboss Application server ConnectionListener.DESTROY and doDestroy(cl);

    rosansamuel Newbie

      Hi Friends,

       

      Could you please tell the difference in between the removal of connection event listener and destroying the connection objects. if we remove the connection event listsener means that connection object could be destroyed. In red you could see the connection marked for destruction. In this part there is no destruction takes place. could please anyone help me

       

      public void flush()

         {

            ArrayList destroy = null;

            synchronized (cls)

            {

               if (trace)

                  log.trace("Flushing pool checkedOut=" + checkedOut + " inPool=" + cls);

       

               // Mark checked out connections as requiring destruction

              for (Iterator i = checkedOut.iterator(); i.hasNext();)

               {

                  ConnectionListener cl = (ConnectionListener) i.next();

                  if (trace)

                     log.trace("Flush marking checked out connection for destruction " + cl);

                  cl.setState(ConnectionListener.DESTROY);

               }

               // Destroy connections in the pool

               while (cls.size() > 0)

               {

                  ConnectionListener cl = (ConnectionListener) cls.remove(0);

                  if (destroy == null)

                     destroy = new ArrayList();

                  destroy.add(cl);

               }

            }

       

            // We need to destroy some connections

            if (destroy != null)

            {

               for (int i = 0; i < destroy.size(); ++i)

               {

                  ConnectionListener cl = (ConnectionListener) destroy.get(i);

                  if (trace)

                     log.trace("Destroying flushed connection " + cl);

                  doDestroy(cl);

               }

       

               // We destroyed something, check the minimum.

               if (shutdown.get() == false && poolParams.minSize > 0)

                  PoolFiller.fillPool(this);

            }