public List cycleAllAsynchronousConnections(boolean recycle) { List returnData = null; synchronized( dataPool ) { returnData = new ArrayList(dataPool);  dataPool.clear(); }
public List cycleAllAsynchronousConnections (boolean recycle) {  if (recycle) { try { List copy = Collections.synchronizedList(new ArrayList(deadConnections)); for (Iterator i = copy.iterator(); i.hasNext(); ) { ConnectionListener cl = (ConnectionListener) i.next(); URLConnexionProbe probe = cl.getConnexionProbe(); ConnexTimer timer = (ConnexTimer) connectionTimers.get(probe); if (!probe.isResolved()) { String resolved_url = resolve(probe.getConfig()); if (resolved_url != null) { try { probe.setURL(new URL(resolved_url)); } catch (MalformedURLException mfe) { System.out.println( "ConnectionManager::cycleAllAsynchronousConnections:  " + "bad URL -- " + resolved_url); connectionTimers.remove(probe); deadConnections.remove(cl); } } }  if (probe.isResolved() && (timer == null || timer.proceed())) cl.start(); } } catch (Exception ex) { ex.printStackTrace(); } }
    public List cycleAllAsynchronousConnections(boolean recycle)    {         List returnData = null;         synchronized( dataPool )         {            returnData = new ArrayList(dataPool);            //System.out.println("[ConnectionManager] dataPool size=" + dataPool.size() + ", " + returnData.size());            dataPool.clear();         }         // CASE DO NOT RECYCLE #########         if( false==recycle) {             try{                    System.out.println("Checking... Still not done..."                                    + ConnectionListener.describeSetOfListeners(getNamespace(), deadConnections));                } catch (Exception ex) {                    ex.printStackTrace();                }        } else {        // CASE RECYCLE ################                try{                    List copy = Collections.synchronizedList(new ArrayList(this.deadConnections));                    synchronized( copy )                    {                       Iterator it2 = copy.iterator();                       while(it2.hasNext() ){                            ConnectionListener cl = (ConnectionListener)it2.next();                            URLConnexionProbe probe = cl.getConnexionProbe();                            ConnexTimer timer = (ConnexTimer)connectionTimers.get(probe);                            if( timer != null ){                                // presume Polling query with timer                                if( timer.proceed() == true ) cl.start();                                // else, try later!                            } else {                                cl.start();                            }                       }                    }               } catch (Exception ex) {                       ex.printStackTrace();               }        }        return returnData;    }