Exemple #1
0
 private static synchronized void kill() {
   if (sessionList != null) {
     for (HTTPSession session : sessionList) {
       session.close();
     }
     sessionList.clear();
     // Rebuild the connection manager
     connmgr.shutdown();
     connmgr = new MultiThreadedHttpConnectionManager();
     setGlobalThreadCount(DFALTTHREADCOUNT);
   }
 }
Exemple #2
0
 public static int getGlobalThreadCount() {
   return connmgr.getParams().getMaxTotalConnections();
 }
Exemple #3
0
 public static void setGlobalConnectionTimeout(int timeout) {
   connmgr.getParams().setConnectionTimeout(timeout);
 }
Exemple #4
0
 public static void setGlobalThreadCount(int nthreads) {
   connmgr.getParams().setMaxTotalConnections(nthreads);
   connmgr.getParams().setDefaultMaxConnectionsPerHost(nthreads);
 }